Sponsored Content
Top Forums Shell Programming and Scripting how to cut a field of a line in a text file? Post 302296967 by bhaskar_m on Thursday 12th of March 2009 08:27:21 AM
Old 03-12-2009
how to cut a field of a line in a text file?

Hi,
I have text file which contains lines like :
a/a/a/a/.project
b/b/b/b/b/.project
c/c/c/.project
d/.project
e/e/e/e/.project

i want for all lines the last word .project should be removed and the file should look like :

a/a/a/a/
b/b/b/b/b/
c/c/c/
....

how to proceed ? Please help. Thanks in advance.
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Text cut between two $ in a line with SED

Let's say I have a line like that: I want to cut out numbers between two $ including $s. The result should be like that: I am so-newbei. I am non-stop reading about SED since yesterday and not a programmer. I know that it is a short period, thus maybe I had overlooked something. I... (4 Replies)
Discussion started by: l_p
4 Replies

2. Shell Programming and Scripting

How to cut first line only from a text near a specific column without cutting a word

First I have to say thank you to this community and this forum. You helped me very much builing several useful scripts. Now, I can't get a solution the following problem, I'm stuck somehow. Maybe someone has an idea. In short, I dump a site via lynx and pipe the output in a file. I need to... (7 Replies)
Discussion started by: lowmaster
7 Replies

3. Shell Programming and Scripting

print line if 2nd field exists in text

2 files, first one has 3 fields seperated by ||| and 2nd one is plain text. I want to copy the lines from the first file if the 2nd field is present anywhere in the text file. This is what I've tried, but I'm new to awk and shell scripting in general so it's kinda broken. #!/bin/awk -f BEGIN... (15 Replies)
Discussion started by: FrancoisCN
15 Replies

4. Shell Programming and Scripting

Help need to cut the first word of a line in text file

Hi All, I would like help with a script which can get rid of the first work of all lines in text file. File 1 The name is Scott. Output : name is Scott ---------- Post updated at 02:38 PM ---------- Previous update was at 02:37 PM ---------- Hi ALL There is typo error in... (3 Replies)
Discussion started by: bubbly
3 Replies

5. Shell Programming and Scripting

cut the second line in a text file

Hi I have some problem to cut out the second line in a output file and send to a new file it's a #!/bin/bash script 1 something 2 something 3 something and after I cut 1 something 3 something New file 2 something Thanks in advance (7 Replies)
Discussion started by: pelle
7 Replies

6. UNIX for Dummies Questions & Answers

Cut a field from a line having quotes as delimiter

Hi , I have extract a single field from the 2nd row of a file of which the format is as given below "Field1","Field2","Field3",...,"Field17",... I need to cut Field17 as such (no quotes required).. I give the command head -2 file_name | tail -1 | cut -d "," -f17 But the output is... (2 Replies)
Discussion started by: nivin_govindan
2 Replies

7. Shell Programming and Scripting

cut command issue from a line of text

Hi, I got a line of text which has spaces in between and it is a long stream of characters. I want to extract the text from certain position. Below is the line and I want to take out 3 characters from 86 to 88 character position. In this line space is also a character. However when using cut... (5 Replies)
Discussion started by: asutoshch
5 Replies

8. Shell Programming and Scripting

Cut third field of every third line

Hello, I have got a log file and would need to write a script to cut the every first and second fields of every third line. Job Name : dummytextd_v1 Status : KILLED TIMEDOUT 2011-05-01 05:33 Job Name : dummyttx_v1 Status : KILLED TIMEDOUT 2011-05-03 02:33 Job Name :... (4 Replies)
Discussion started by: Kochappa
4 Replies

9. Shell Programming and Scripting

Update specific field in a line of text file

I have a text file like this: subject1:LecturerA:10 subject2:LecturerA:40 if I was given string in column 1 and 2 (which are subject 1 and LecturerA) , i need to update 3rd field of that line containing that given string , which is, number 10 need to be updated to 100 ,for example. The... (6 Replies)
Discussion started by: bmtoan
6 Replies

10. Shell Programming and Scripting

Command/script to match a field and print the next field of each line in a file.

Hello, I have a text file in the below format: Source Destination State Lag Status CQA02W2K12pl:D:\CAQA ... (10 Replies)
Discussion started by: pocodot
10 Replies
vala-gen-project(1)						   USER COMMANDS					       vala-gen-project(1)

NAME
vala-gen-project - generate the and automake skeleton for your vala project SYNOPSIS
vala-gen-project [OPTION...] [NAME] DESCRIPTION
Vala project generator is a little gui or command line utility that creates an automake project skeletoni vala program. It can be used without specifying a project name, so that a gtk+ gui will be presented or directly from the command line. OPTIONS
-?, --help Show help options -p, --projectdir=DIRECTORY Project directory -t, --type=TYPE Project TYPE: gtk+, console -l, --license=TYPE License TYPE: gpl2, gpl3, lgpl2, lgpl2.1, lgpl3, apache2, artistic --version Display version number -a, --author=NAME Author name -e, --email=EMAIL Author email address EXAMPLES
Create a gtk+ project with a gpl2 license and the name valatest vala-gen-project -t gtk+ -l gpl2 valatest EXIT STATUS
vala-gen-project returns a zero exist status if it succeed. Non zero is returned in case of failure. AUTHOR
Andrea Del Signore (sejerpz (at) tin.it) SEE ALSO
valac(1) version 0.1.0 December 24, 2008 vala-gen-project(1)
All times are GMT -4. The time now is 02:33 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy