473,322 Members | 1,480 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,322 software developers and data experts.

How to replace comma with newline n/ in a specific column content of a csv file

Example:
having this header:
User Name JobCodes

and the data for each column:
w004,William,100
jme3,Jhon,200

the challenge is coming here, this particular record has more than one "JobCode":
v4002,Victor,300,400,500

so, these 3 values belong only to "JobCode" column, How can i replace commas with newlines having the expected result for this particular record:

v4002,Victor, 300
400
500

it is possible to get this format for that particular column?? please help!!!
Sep 25 '15 #1
3 4556
the job codes should be listed in order, in this way inside JobCodes column:
300
400
500
Sep 25 '15 #2
RonB
589 Expert Mod 512MB
Putting the JobCodes on separate lines like that will break the csv formatting. Instead, that list should be enclosed in quotes to retain proper csv format.
Sep 25 '15 #3
Oralloy
985 Expert 512MB
ulitech,

Are you looking to create a long-term tool, or a throw-away?

In other words, what are the full requirements, so that we know best how to guide you.

Take a look at the "awk" tool, as it should be able to solve your problem with a line or two.

Alternately, the "sed" tool might be appropriate to your needs.

Luck,
Oralloy
Sep 1 '16 #4

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

Similar topics

2
by: padam.singh | last post by:
Hi, I enable All Warnings during compiling my programs. What is the significance of this warning: warning: no newline at end of file I use gcc to compile, but wonder why it needs a newline...
0
by: Leeor Chernov | last post by:
Hi , I am using the method: DSSap.ReadXml( XmlPath,XmlReadMode.InferSchema ); And as I expected I get an error when the xml does not matching my DataSet that contains already a schema , The...
2
by: TB | last post by:
Before displaying the result of a table called "people" in a datagrid called "mydatagrid", I need to modify the content of a column called "moreinfo" in the in-memory datatable (but not the...
0
by: Problematic coder | last post by:
Hi, I have just been asked to create an app that will import a specific column from an excel spreadsheet, something like sheet1 columnD or a column with the first row with a value of 'ID'...
6
convexcube
by: convexcube | last post by:
After searching the web for a solution to total a specific column in a list box and not finding it, I came up with this: Dim varTotal As Currency Dim varRow As Integer For varRow = 1 To...
7
by: cesco | last post by:
Hi, I have a file containing four columns of data separated by tabs (\t) and I'd like to read a specific column from it (say the third). Is there any simple way to do this in Python? I've...
2
by: anatanat | last post by:
hello :) I want to bind a combobox to a specific column in a DataTable. I want the combobox items to display distinct values. I tried: combo.datasource = dataTable; combo.DisplayMember =...
2
by: sukatoa | last post by:
I have a table, where it composed of several columns, but i am concerning only on a specific column with datatype varchar under that db table... Now, for example: column: links values: ...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

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.