Select sections of text from each line of files in a Bash shell

0 votes

Hi Team,

I have one CSV file. I want to extract some text from each line. How can I do that?

Oct 20, 2020 in Linux Administration by akhtar
• 38,230 points
775 views

1 answer to this question.

0 votes

Hi@akhtar,

There is no inbuild command available for your requirement. But you can create your own customized command. To select some texts from a file, you can use the cut command as shown below.

$ cat data.csv | cut -c 1-6
System
569,Ha
570,Ha
571,Ha
572,Ha
answered Oct 20, 2020 by MD
• 95,440 points

Related Questions In Linux Administration

0 votes
1 answer

generating a list of files with their absolute path in Linux

If you find an absolute path to start with, ...READ MORE

answered May 16, 2019 in Linux Administration by Upasana
• 8,620 points
1,195 views
0 votes
0 answers

How can I convert a series of images to a PDF from the command line on linux?

I have a scanning server I wrote ...READ MORE

Apr 21, 2022 in Linux Administration by Edureka
• 13,670 points
316 views
0 votes
1 answer

Is there a limit on the number of words in bash command 'for file in words'?

Anyway, you need to print everything except ...READ MORE

answered May 27, 2022 in Linux Administration by Korak
• 5,820 points
431 views
0 votes
1 answer

How do I check if a directory exists in a Bash shell script?

To check if a directory exists in ...READ MORE

answered Jun 7, 2022 in Linux Administration by Korak
• 5,820 points
1,545 views
0 votes
1 answer
0 votes
1 answer

setting a variable output from a bash command

You can use $(command), which in my ...READ MORE

answered Feb 15, 2019 in Linux Administration by DareDev
• 6,890 points
2,243 views
0 votes
1 answer

How to sort text alphabetically in Linux system?

Hi@akhtar, In the Linux system, you will find ...READ MORE

answered Oct 20, 2020 in Linux Administration by MD
• 95,440 points
24,289 views
0 votes
1 answer
0 votes
1 answer

How to find the first field from a file in Bash Shell?

Hi@akhtar, You can extract text from a file. ...READ MORE

answered Oct 20, 2020 in Linux Administration by MD
• 95,440 points
875 views
0 votes
1 answer

How to check permissions of a file in the Linux system?

Hi@akhtar, If you prefer using the command line, ...READ MORE

answered Aug 13, 2020 in Linux Administration by MD
• 95,440 points
1,530 views
webinar REGISTER FOR FREE WEBINAR X
REGISTER NOW
webinar_success Thank you for registering Join Edureka Meetup community for 100+ Free Webinars each month JOIN MEETUP GROUP