If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Data Access, Manipulation & Batch Languages > Unix Shell Scripts > Re-arrange the columns

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 09-23-05, 06:44
ahmedwaseem2000 ahmedwaseem2000 is offline
Registered User
 
Join Date: Jan 2005
Posts: 75
Re-arrange the columns

Hi - can any one let me know how to re-arrange the columns of a comma seperated file. The problem here is that the colums some times have new lines and when the columns has new lines or extra comma's then it is enclosed in double quotes("). Can any one tell me how to re-arrange the columns now.

Thanks in advance.
Reply With Quote
  #2 (permalink)  
Old 09-26-05, 10:47
ducasio ducasio is offline
Registered User
 
Join Date: Aug 2004
Location: Rome, Italy
Posts: 81
Sorry, but I don't understand what do you mean with "re-arrange columns". Can you give an example with what you have as intput and what do you expect for output?

bye
Reply With Quote
  #3 (permalink)  
Old 09-28-05, 03:05
ahmedwaseem2000 ahmedwaseem2000 is offline
Registered User
 
Join Date: Jan 2005
Posts: 75
yes, here is the example row.

current row:

1,2,3,"x,x,x", "y
y
Y", 6,7,8

expected output:

8,7,6,"y
y
Y","x,x,x",3,2,1

there are 8 columsn. that means the order of the column is changed and the field with y's are spread in 3 lines and the field with x's has more comma's
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On