Sponsored Content
Top Forums Shell Programming and Scripting Reading txt files using the awk Post 302687091 by RudiC on Thursday 16th of August 2012 03:24:40 AM
Old 08-16-2012
If you don't mind using sed, try
Code:
sed 's/^/Chain->Add("/; s/$/");/'

as a filter in your long pipe. It just replaces the start-of-string (^) with your first constant and the end-of-string ($) with the second.
If this does not do what you want, pls post more info on your problem, as I'm not sure I understand what your script is doing.
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Reading Two files at the same time using awk

Hi All, I am very new to awk script writing. I have two files(file1 and file2) containing some numbers. I want divide the numbers in file1 with those in file 2 line wise. is it possible to simultaneousely read the information from both files and carry put the division. Thanks a lot in... (6 Replies)
Discussion started by: suneeldutt
6 Replies

2. Shell Programming and Scripting

reading from 2 files using awk

hi, Is it possible to read and compare 2 files which have different Field separators at the same time using awk??? file1: 1,dayal,maruti,Z-234,bangalore,KA,........ 2,yash,esteem,Y-007,delhi,DL,........... . . . fill 2: Z-234|Registered|Bangalore Y-007|Registered|Bangalore . . . ... (2 Replies)
Discussion started by: VGR
2 Replies

3. Shell Programming and Scripting

Reading files using AWK or SED

hi Friends, Please help me to give a try for writing a shell script either with awk or SED for the below requirement. i have file with 3 lines, each of size 3200 chars, wanted to read this file and divide eachline with 200 columns with differensizes for each column value by keeping seperator.... (3 Replies)
Discussion started by: balireddy_77
3 Replies

4. Shell Programming and Scripting

awk-files in a txt

There is a file that contains access's data to a web server. Each line of the file (it's big) it's : IP Client - - "Command Path Protocol" code size "client software" Example,for the first line: IP Client is 67.195.37.107, date-hour is , Command Path Protocol is "Get /papers/ISO4nm.pdf ... (1 Reply)
Discussion started by: Mark_orig
1 Replies

5. Shell Programming and Scripting

reading files using awk

Hi , I have a awk script to read a file using getline, but when its not able to recognize the path of the file. I am working on solaris unix. nawk -F'|' ' BEGIN{ FILE1="/input_files/temp.txt" } I have to place my script in the same folder i.e /input_files/ for my script to work. ... (2 Replies)
Discussion started by: rashmisb
2 Replies

6. Shell Programming and Scripting

awk append fileA.txt to growing file B.txt

This is appending a column. My question is fairly simple. I have a program generating data in a form like so: 1 20 2 22 3 23 4 12 5 43 For ever iteration I'm generating this data. I have the basic idea with cut -f 2 fileA.txt | paste -d >> FileB.txt ???? I want FileB.txt to grow, and... (4 Replies)
Discussion started by: theawknewbie
4 Replies

7. Shell Programming and Scripting

Help with reading two input files in awk

Hello, I'm trying to write an awk program that reads two files inputs. example, file 1: 0.00017835 0.000176738 0.00018811 0.000189504 0.000188155 0.000180065 0.000178991 0.000178252 0.000182513 file 2: 1.7871769E-05 1.5139576E-16 1.5140196E-16 1.5139874E-16 1.7827407E-04 ... (5 Replies)
Discussion started by: joseamck
5 Replies

8. UNIX for Dummies Questions & Answers

Comparing two txt files with AWK

Hi, I need to compare two text files with awk. File1: ------- chr1 43815007 43815009 COSM19193 REF=TG;OBS=AA;ANCHOR=G AMPL495041 chr1 43815008 43815009 COSM18918 REF=G;OBS=T;ANCHOR=T AMPL495041 chr1 115256527 115256528 ... (6 Replies)
Discussion started by: RushiK
6 Replies

9. Shell Programming and Scripting

Desired output.txt for reading txt file using awk?

Dear all, I have a huge txt file (DATA.txt) with the following content . From this txt file, I want the following output using some shell script. Any help is greatly appreciated. Greetings, emily DATA.txt (snippet of the huge text file) 407202849... (2 Replies)
Discussion started by: emily
2 Replies

10. Shell Programming and Scripting

Awk, sed, shell all words in INPUT.txt find in column1 of TABLE.txt and replce with column2 in

Hi dears i have text file like this: INPUT.txt 001_1_173 j nuh ]az 001_1_174 j ]esma. nuh ]/.xori . . . and have another text like this TABLE.txt j j nuh word1... (6 Replies)
Discussion started by: alii
6 Replies
unix2dos(1)						      General Commands Manual						       unix2dos(1)

NAME
unix2dos - UNIX to DOS text file format converter SYNOPSYS
unix2dos [options] [-c convmode] [-o file ...] [-n infile outfile ...] Options: [-hkqV] [--help] [--keepdate] [--quiet] [--version] DESCRIPTION
This manual page documents unix2dos, the program that converts text files in UNIX format to DOS format. OPTIONS
The following options are available: -h --help Print online help. -k --keepdate Keep the date stamp of output file same as input file. -q --quiet Quiet mode. Suppress all warning and messages. -V --version Prints version information. -c --convmode convmode Sets conversion mode. Simulates unix2dos under SunOS. -o --oldfile file ... Old file mode. Convert the file and write output to it. The program default to run in this mode. Wildcard names may be used. -n --newfile infile outfile ... New file mode. Convert the infile and write output to outfile. File names must be given in pairs and wildcard names should NOT be used or you WILL lost your files. EXAMPLES
Get input from stdin and write output to stdout. unix2dos Convert and replace a.txt. Convert and replace b.txt. unix2dos a.txt b.txt unix2dos -o a.txt b.txt Convert and replace a.txt in ASCII conversion mode. Convert and replace b.txt in ISO conversion mode. unix2dos a.txt -c iso b.txt unix2dos -c ascii a.txt -c iso b.txt Convert and replace a.txt while keeping original date stamp. unix2dos -k a.txt unix2dos -k -o a.txt Convert a.txt and write to e.txt. unix2dos -n a.txt e.txt Convert a.txt and write to e.txt, keep date stamp of e.txt same as a.txt. unix2dos -k -n a.txt e.txt Convert and replace a.txt. Convert b.txt and write to e.txt. unix2dos a.txt -n b.txt e.txt unix2dos -o a.txt -n b.txt e.txt Convert c.txt and write to e.txt. Convert and replace a.txt. Convert and replace b.txt. Convert d.txt and write to f.txt. unix2dos -n c.txt e.txt -o a.txt b.txt -n d.txt f.txt DIAGNOSTICS
BUGS
The program does not work properly under MSDOS in stdio processing mode. If you know why is that so, please tell me. AUTHOR
Benjamin Lin - ( blin@socs.uts.edu.au ) MISCELLANY
Tested environment: Linux 1.2.0 with GNU C 2.5.8 SunOS 4.1.3 with GNU C 2.6.3 MS-DOS 6.20 with Borland C++ 4.02 Suggestions and bug reports are welcome. SEE ALSO
dos2unix(1) 1995.03.31 unix2dos v2.2 unix2dos(1)
All times are GMT -4. The time now is 08:51 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy