Linux Help
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me

The Shed is going Social! Join us on FaceBook and Twitter and chime in on the conversation.

Go Back   Dev Shed ForumsOperating SystemsLinux Help

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
  #1  
Old February 6th, 2012, 01:57 PM
omgjtt omgjtt is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Aug 2010
Posts: 35 omgjtt User rank is Sergeant (500 - 2000 Reputation Level)omgjtt User rank is Sergeant (500 - 2000 Reputation Level)omgjtt User rank is Sergeant (500 - 2000 Reputation Level)omgjtt User rank is Sergeant (500 - 2000 Reputation Level)omgjtt User rank is Sergeant (500 - 2000 Reputation Level) 
Time spent in forums: 10 h 5 m 37 sec
Reputation Power: 13
Moving text into a csv file

I did a CURL on a web page and stripped out the information I wanted and placed it inside a text file (data.txt).

Lets say it contains the following: (no comas)

John 15 65kb/sec

I am then wanting to pipe that into a master csv file.

How can I add john first, 15 second and so on.

The csv should look like this: John, 15, 65kb/sec,

is there a simple way to append and pipe it in the csv

adding the comas where the spaces are

data.txt >> masterlist.csv

Any help would be great,

James

Last edited by omgjtt : February 6th, 2012 at 02:09 PM.

Reply With Quote
  #2  
Old February 6th, 2012, 02:26 PM
omgjtt omgjtt is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Aug 2010
Posts: 35 omgjtt User rank is Sergeant (500 - 2000 Reputation Level)omgjtt User rank is Sergeant (500 - 2000 Reputation Level)omgjtt User rank is Sergeant (500 - 2000 Reputation Level)omgjtt User rank is Sergeant (500 - 2000 Reputation Level)omgjtt User rank is Sergeant (500 - 2000 Reputation Level) 
Time spent in forums: 10 h 5 m 37 sec
Reputation Power: 13
I found the answer. For those of you dealing with the same issue I would play around with the tr command. Here is a bit of code I hope helps

tr ' ' ',' <input >output

If you want to append the data please make sure to add two greater than signs

tr ' ' ',' <input.txt >> output.csv

Thanks

Reply With Quote
Reply

Viewing: Dev Shed ForumsOperating SystemsLinux Help > Moving text into a csv file

Developer Shed Advertisers and Affiliates



Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


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

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump

Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 


Powered by: vBulletin Version 3.0.5
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.

© 2003-2013 by Developer Shed. All rights reserved. DS Cluster - Follow our Sitemap