[Webinar] Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 177
  • Last Modified:

Read the Second line of the file from set of files in the same folder

I have 8 FIles in the same folder. I would like to read only the second line from each file. How do i do it.



File1.txt
============
20111015083354,1
1105304144
EOF


File2.txt
=========
20111015083354,1
11053041178
EOF

File2.txt
==========
20111015083354,1
1105304263
EOF

File4.txt
==========
20111015083354,1
1105304216
EOF

File5.txt
============
20111015083354,1
0105304145
EOF


File6.txt
=========
20111015083354,1
11053012456
EOF

File7.txt
==========
20111015083354,1
110530414234
EOF

File8.txt
==========
20111015083354,1
11053041we
EOF

0
ratna1234
Asked:
ratna1234
1 Solution
 
TintinCommented:
for file in File?.txt
do
   sed -n 2p $file
done

Open in new window

0
 
ratna1234Author Commented:
Thanks
0

Featured Post

New feature and membership benefit!

New feature! Upgrade and increase expert visibility of your issues with Priority Questions.

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