• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 2383
  • Last Modified:

How to manipulate CSV file in sed?

I have a CSV file, with 7 values separated by commas.
I want a file that contains only the first value , and another file that contains only the 3rd value .
I have GNU sed, no awk , no perl (this is a windows server).

Shalom
0
shalomc
Asked:
shalomc
1 Solution
 
sunnycoderCommented:
Hi shalomc,

> I want a file that contains only the first value ,
sed 's:\([^,]*\).*:\1:' inputfile

>and another file that contains only the 3rd value .
sed 's:[^,]*,[^,]*,\([^,]*\).*:\1:' inputfile

Cheers!
0
 
shalomcAuthor Commented:
(^_^)


0

Featured Post

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now