Reputation: 709
I have a file with the following text
and I want to get the 1st,2nd,and 4th value only**1343311371204**,*****210*****,http://172.16.1.139/CC_WEB/jsp/Login.jsp,**200**,OK,true,9,9
1343311371044,304,http://172.16.1.139/CC_WEB/jsp/Login.jsp,200,OK,true,8,8
1343311371109,239,http://172.16.1.139/CC_WEB/jsp/Login.jsp,200,OK,true,8,8
1343311371083,263,http://172.16.1.139/CC_WEB/jsp/Login.jsp,200,OK,true,8,8
in every line. So How can I do it?
Upvotes: 0
Views: 5237
Reputation: 945
cut -d, -f1,2,4 your_file
should do it fine.
Using read in a while loop, you can use variables to do things with those values :
while IFS=',' read timestamp value2 url code remains ; do
# use those variables
done < your_file`
Upvotes: 3