473,385 Members | 1,764 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

Parse field that contains \n as a delimiter

We have a program that runs on a linux machine that outputs a text file. The description field has \n as line breaks.

here is an example:

\nSynopsis :\n\nError on machine.\n\nDescription :\n\nThere is a report of volnerability\nthis would make the computer at risk\nSolution :\n\nSolution:\nInstall new patches

Is there a way to make the \n as line breaks on a report or form?

I currently just have an imported table that has a findingID and then the description, which is the data above.
Jan 28 '10 #1

✓ answered by missinglinq

How about
Expand|Select|Wrap|Line Numbers
  1. =Replace(Me.TargetString, "\n", vbNewLine)
Linq ;0)>

12 2775
beacon
579 512MB
Hi barmatt,

Have you tried using the character codes for carriage return and line feed if "/n" is in the string?

I've added textboxes to reports and if I add "Chr(13) & Chr(10)" to the textbox it will do a break. I would think that you should be able to setup something similar using the instr and replace functions to accomplish your task.
Jan 28 '10 #2
good idea i'll give it a try
Jan 28 '10 #3
beacon
579 512MB
FYI...be careful when using "Chr(13) & Chr(10)" in a textbox (can't be a label) on your report. I've had mixed results in the past if I only used "Chr(13)" or "Chr(10)" without the other to accompany it.
Jan 28 '10 #4
missinglinq
3,532 Expert 2GB
How about
Expand|Select|Wrap|Line Numbers
  1. =Replace(Me.TargetString, "\n", vbNewLine)
Linq ;0)>
Jan 28 '10 #5
NeoPa
32,556 Expert Mod 16PB
Interesting. I've always used vbCrLf, but it seems that is exactly the same as vbNewLine (which I didn't know about). That should certainly do the trick anyway. Essentially what Beacon was proposing, but using the inbuilt named values instead.
Jan 30 '10 #6
missinglinq
3,532 Expert 2GB
I like vbNewLine because it's easy to remember and it does exactly what its name suggests, not always the case in VBA!

Linq ;0)>
Jan 30 '10 #7
NeoPa
32,556 Expert Mod 16PB
Coming from the days where CR & LF were used individually (but together) the vbCrLf always made sense to me, but I can see why vbNewLine would appeal generally. I'm inclined to agree it's a more general and easily understood version. I may just have to switch now I've learned about it :)
Jan 30 '10 #8
missinglinq
3,532 Expert 2GB
You're telling your age now, NeoPa! I , too, come from that time! I started coding in QuickBasic 4.5, which was later used as the engine for VB and hence VBA. When people complain about how hard it is to do this or that in VBA I just have to laugh! I remember having to write a page-and-a-half of code to add a given number of weeks to a date! VBA is way more powerful than most people realize!

Linq ;0)>
Jan 31 '10 #9
Delerna
1,134 Expert 1GB
Oh no! I haven't thought about quick basic in decades, now it all comes flooding back.
Jan 31 '10 #10
NeoPa
32,556 Expert Mod 16PB
Although I came across some versions of BASIC in my earlier career, the time I'm talking about I hadn't done any. At that time it was all Assembler, COBOL & RPGII. When I moved on to C in the early 80s they introduced the \n, which handled new lines, but it was far less hardware dependent by then.
Feb 1 '10 #11
thanks missinglinq... your suggestion did the trick
Feb 5 '10 #12
missinglinq
3,532 Expert 2GB
Glad we could help!

Linq ;0)>
Feb 5 '10 #13

Sign in to post your reply or Sign up for a free account.

Similar topics

5
by: David | last post by:
I have an xml file that, for example, contains the following element: - <data>\x0095 blah1 \x0095 blah2 \x0095 blah3 \x0095 blah4</data> If I use XmlTextReader.ReadString() to read this data...
22
by: Ram Laxman | last post by:
Hi all, I have a text file which have data in CSV format. "empno","phonenumber","wardnumber" 12345,2234353,1000202 12326,2243653,1000098 Iam a beginner of C/C++ programming. I don't know how to...
5
by: Theresa Hancock via AccessMonster.com | last post by:
I have an Excel table I need to import into Access. The name is entered into one field "Name". I'd like to have two fields in Access, FirstName and LastName. How do I do this. -- Message posted...
19
by: Johnny Google | last post by:
Here is an example of the type of data from a file I will have: Apple,4322,3435,4653,6543,4652 Banana,6934,5423,6753,6531 Carrot,3454,4534,3434,1111,9120,5453 Cheese,4411,5522,6622,6641 The...
11
by: hoopsho | last post by:
Hi Everyone, I am trying to write a program that does a few things very fast and with efficient use of memory... a) I need to parse a space-delimited file that is really large, upwards fo a...
6
by: Richard | last post by:
Which way would you guys recommened to best parse a multiline file which contains two fields seperated by a tab. In this case its the linux/proc/filesystems file a sample of which I have included...
29
by: gs | last post by:
let say I have to deal with various date format and I am give format string from one of the following dd/mm/yyyy mm/dd/yyyy dd/mmm/yyyy mmm/dd/yyyy dd/mm/yy mm/dd/yy dd/mmm/yy mmm/dd/yy
1
AdrianH
by: AdrianH | last post by:
Assumptions I am assuming that you know or are capable of looking up the functions I am to describe here and have some remedial understanding of C programming. FYI Although I have called this...
13
by: bobc | last post by:
In my stored procedure, I want to parse @ArrayOfDays into @d1 through @d5. @ArrayOfDays is a varchar input parameter containing, for example, "1.7.21.25.60." - five elements. Most active...
25
by: Rick Collard | last post by:
Using DAO 3.6 on an Access 2002 database, I'm getting unexpected results with the FindFirst method. Here's the simple code to test: Public Sub FindIt() Dim db As Database, rs As Recordset...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.