Sponsored Content
Top Forums Shell Programming and Scripting Command to remove numbers from beginning of txt file Post 302389641 by li_bi on Monday 25th of January 2010 11:56:51 AM
Old 01-25-2010
Bug Command to remove numbers from beginning of txt file

Hello. I have the following issue: my txt file has the following format:
train/dr4/fklc0/sx175.txt 0 80282 Severe myopia contributed to Ron's inferiority complex. train/dr4/fklc0/sx355.txt 0 42906 Dolphins are intelligent marine mammals. train/dr4/fklc0/sa2.txt

With the command:
Code:
awk 'NR%2==0' test1.txt > test2.txt

I managed to
eliminate the first , third and fifth sentence. I don't know what command to use to eliminate the numbers at
the beginning of each line and put it in another output file.

Thank you very much
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

sed to remove last 2 characters of txt file

sed 's/^..//' file1.txt > file2.txt this will remove the first two characters of each line of a text file, what sed command will remove the last two characters? This is a similar post to my other....sry if I'm being lazy.... I need a file like this (same as last post) >cat file1.txt 10081551... (1 Reply)
Discussion started by: ajp7701
1 Replies

2. Shell Programming and Scripting

command to list .txt and .TXT file

Hi expersts, in my directory i have *.txt and *.TXT and *.TXT.log, *.txt.log I want list only .txt and .TXT files in one command... how to ?? //purple (1 Reply)
Discussion started by: thepurple
1 Replies

3. UNIX for Dummies Questions & Answers

to remove space in a txt file

I want to fetch text after the first occurance of the word "started at" i.e. consider a text written below... echo 'hi how r u ' Started at MON Jan 11 00:03:24 EST 2009 echo 'hi how is ur job goin on' Started at Sun Jan 11 00:03:24 EST 2004 Started at TUE Jan 11 00:03:24 EST 2005 Started... (19 Replies)
Discussion started by: manit
19 Replies

4. UNIX for Dummies Questions & Answers

Remove words beginning with a certain character from a file

Hi, how could you go about removing words that begin with a certain character. assuming that this character is '-' I currently have echo "-hello" | sed s/-/""/ which replaces the leading dash with nothing but I want to remove the whole word, even if there are multiple words beginning... (3 Replies)
Discussion started by: skinnygav
3 Replies

5. Shell Programming and Scripting

Remove repeating pattern from beginning of file names.

I want a shell script that will traverse a file system starting at specific path. And look at all file names for repeating sequences of and remove them from the file name. The portion of the name that gets removed has to be a repeating sequence of the same characters. So the script would... (3 Replies)
Discussion started by: z399y
3 Replies

6. UNIX for Dummies Questions & Answers

Command to delete numbers at beginning of txt file line

Hello. I have the following issue: my txt file has the following format: train/dr4/fklc0/sx175.txt 0 80282 Severe myopia contributed to Ron's inferiority complex. train/dr4/fklc0/sx355.txt 0 42906 Dolphins are intelligent marine mammals. train/dr4/fklc0/sa2.txt awk 'NR%2==0' test1.txt >... (4 Replies)
Discussion started by: li_bi
4 Replies

7. UNIX for Dummies Questions & Answers

Extract numbers from .txt file

I need to extract all the p-value numbers and the rho numbers from a .txt file and write them as coma separated values in a new file. Ideally I would get two files in the end, one for p- values and one for rho. Any suggestions? I appreciate your help!!! The .txt file looks essentially like this... (5 Replies)
Discussion started by: eggali
5 Replies

8. Shell Programming and Scripting

Finding consecutive numbers in version names on a txt file

Hi all. I have a directory which contains files that can be versioned. All the files are named according to a pattern like this: TEXTSTRING1-001.EXTENSION TEXTSTRING2-001.EXTENSION TEXTSTRING3-001.EXTENSION ... TEXTSTRINGn-001.EXTENSION If a file is versioned, a file called ... (10 Replies)
Discussion started by: fox1212
10 Replies

9. Shell Programming and Scripting

Remove certain lines from file based on start of line except beginning and ending

Hi, I have multiple large files which consist of the below format: I am trying to write an awk or sed script to remove all occurrences of the 00 record except the first and remove all of the 80 records except the last one. Any help would be greatly appreciated. (10 Replies)
Discussion started by: nwalsh88
10 Replies

10. Shell Programming and Scripting

How to remove. (dot) if found in the beginning of file name while doing wget (download)?

Dear All, How to remove. (dot) if found in the beginning of file name while doing wget (download)? I am facing problem while re-sizing the image by using ImageMagick. Two dots in the file name are causing problem. ImageMagick is skipping such image with a dot . in the beginning, like ... (1 Reply)
Discussion started by: Praveen Pandit
1 Replies
fst-train(1)							     fst-train							      fst-train(1)

NAME
fst-train - learning transducer weights SYNOPSIS
fst-train [ options ] file [ input-file ] OPTIONS
-t file use multiple transducers in the same way as fst-infl2. -b This option is used for supervised training with disambiguated data. -d Disambiguate the analyses symbolically as described in the man pages of fst-infl2. -q quiet mode DESCRIPTION
fst-train is used to learn statistical weights for the transducers transitions based on training data. Training is either unsupervised (default) or supervised (option -b). In supervised mode, the input contains fully disambiguated data with the surface and the analysis form. The format restrictions are identi- cal to those applying for lexicon entries, i.e. all operators other than the colon operator (:) are interpreted literally. In unsupervised mode, the input data consists of surface strings. The format is identical to the input format of fst-infl and fst-infl2. The transducer weights are stored in files whose names are obtained by appending .prob to the names of the transducer files. BUGS
No bugs are known so far. SEE ALSO
fst-infl2, fst-compiler AUTHOR
Helmut Schmid, Institute for Computational Linguistics, University of Stuttgart, Email: schmid@ims.uni-stuttgart.de, This software is available under the GNU Public License. October 2005 fst-train(1)
All times are GMT -4. The time now is 04:05 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy