Sponsored Content
Top Forums UNIX for Advanced & Expert Users how do you parse 1 line at a time of file1 ie. line(n) each line into new file Post 302329503 by web_developer on Sunday 28th of June 2009 12:07:11 PM
Old 06-28-2009
Input file dfn and Output file(s) dfn

My input file is a list of html code for products that have a unique key as their id numbers in the description of the code..

test1
<html>(the code for product #####)</html> <==a complete webpage
i wanted to use the cnt value to represent a unique means of createing a new and different file fore each line in he test1 file so in essenct, it is creating a new html file for each line which I have tested and verified is seperated by a carrage return and no tabs or carage returns in the line itself.


filename.txt is another possible input file i tried to used a mv script to change the name of the cnt.html files created by the first script
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

SED help (remove line::parse again::add line)

Aloha! I have just over 1k of users that have permissions that they shouldn't under our system. I need to parse a provided list of usernames, check their permissions file, and strip the permissions that they are not allowed to have. If upon the permissions strip they are left with no permissions,... (6 Replies)
Discussion started by: Malumake
6 Replies

2. Shell Programming and Scripting

cat file1 read line-per-line then grep -A 15 lines down in fileb

STEP 1 # Set variable FILE=/tmp/mainfile SEARCHFILE =/tmp/searchfile # THIS IS THE MAIN FILE. cat /tmp/mainfile Interface Ethernet0/0 "outside", is up, line protocol is up Hardware is i82546GB rev03, BW 100 Mbps Full-Duplex(Full-duplex), 100 Mbps(100 Mbps) MAC address... (6 Replies)
Discussion started by: irongeekio
6 Replies

3. Shell Programming and Scripting

Compare multiple fields in file1 to file2 and print line and next line

Hello, I have two files that I need to compare and print out the line from file2 that has the first 6 fields matching the first 6 fields in file1. Complicating this are the following restrictions 1. file1 is only a few thousand lines at most and file2 is greater than 2 million 2. I need to... (7 Replies)
Discussion started by: gillesc_mac
7 Replies

4. Shell Programming and Scripting

Replacing line 'i' of file1 with line 'j' of file 2

Hi All, As mentioned in the title I have two text files and I would like to replace line number 5 of file #1 with line number 4 of file #2 e.g. file 1 wqwert 4.4464002 3 319 286 369 46.320002 56.150002 45.100002 1 1 1 0.723 (12 Replies)
Discussion started by: f_o_555
12 Replies

5. UNIX for Dummies Questions & Answers

Parsing file, reading each line to variable, evaluating date/time stamp of each line

So, the beginning of my script will cat & grep a file with the output directed to a new file. The data I have in this file needs to be parsed, read and evaluated. Basically, I need to identify the latest date/time stamp and then calculate whether or not it is within 15 minutes of the current... (1 Reply)
Discussion started by: hynesward
1 Replies

6. Shell Programming and Scripting

Using regex's from file1, print line and line after matches in file2

Good day, I have a list of regular expressions in file1. For each match in file2, print the containing line and the line after. file1: file2: Output: I can match a regex and print the line and line after awk '{lines = $0} /Macrosiphum_rosae/ {print lines ; print lines } ' ... (1 Reply)
Discussion started by: pathunkathunk
1 Replies

7. Shell Programming and Scripting

Need a program that read a file line by line and prints out lines 1, 2 & 3 after an empty line...

Hello, I need a program that read a file line by line and prints out lines 1, 2 & 3 after an empty line... An example of entries in the file would be: SRVXPAPI001 ERRO JUN24 07:28:34 1775 REASON= 0000, PROCID= #E506 #1065: TPCIPPR, INDEX= 003F ... (8 Replies)
Discussion started by: Ferocci
8 Replies

8. Shell Programming and Scripting

Ksh: Read line parse characters into variable and remove the line if the date is older than 50 days

I have a test file with the following format, It contains the username_date when the user was locked from the database. $ cat lockedusers.txt TEST1_21062016 TEST2_02122015 TEST3_01032016 TEST4_01042016 I'm writing a ksh script and faced with this difficult scenario for my... (11 Replies)
Discussion started by: humble_learner
11 Replies

9. UNIX for Beginners Questions & Answers

Read 2 file line by line @ same time

HI All, I am aware of reading one file line by line but now my requirement is to read 2 file line by line as below explained. I have 2 files as below file 1 with spaces and file 2 same as file1 but without space and () brackets now i have to read both file line by line and use first line of... (13 Replies)
Discussion started by: abhaydas
13 Replies

10. UNIX for Beginners Questions & Answers

Get an output of lines in pattern 1st line then 10th line then 11th line then 20th line and so on.

Input file: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 (6 Replies)
Discussion started by: Sagar Singh
6 Replies
cdtoc(4)							   File Formats 							  cdtoc(4)

NAME
cdtoc - CD-ROM table of contents file DESCRIPTION
The table of contents file, .cdtoc, is an ASCII file that describes the contents of a CD-ROM or other software distribution media. It resides in the top-level directory of the file system on a slice of a CD-ROM. It is independent of file system format, that is, the file system on the slice can be either UFS or HSFS. Each entry in the .cdtoc file is a line that establishes the value of a parameter in the following form: PARAM=value Blank lines and comments (lines preceded by a pound-sign, ``#'') are also allowed in the file. Parameters are grouped by product, with the beginning of a product defined by a line of the form: PRODNAME=value Each product is expected to consist of one or more software packages that are stored together in a subdirectory on the distribution media. There can be any number of products described within the file. There is no required order in which the parameters must be specified, except that the parameters must be grouped by product and the PRODNAME parameter must appear first in the list of parameters for each product specified. Each parameter is described below. All of the parameters are required for each product. PRODNAME The full name of the product. This must be unique within the .cdtoc file and is preferably unique across all possi- ble products. This value may contain white space. The length of this value is limited to 256 ASCII characters; other restrictions may apply (see below). PRODVERS The version of the product. The value can contain any combination of letters, numbers, or other characters. This value may contain white space. The length of this value is limited to 256 ASCII characters; other restrictions may apply (see below). PRODDIR The name of the top-level directory containing the product. This name should be relative to the top-level directory of the distribution media, for example, Solaris_2.6/Product. The number of path components in the name is limited only by the system's maximum path name length, which is 1024 ASCII characters. Any single component is limited to 256 ASCII characters. This value cannot contain white space. The lengths of the values of PRODNAME and PRODVERS are further constrained by the fact that the initial install programs concatenate these values to produce the full product name. For unbundled products the combined length of the values of PRODNAME and PRODVERS must not exceed 256 ASCII characters. When you install OS services with Solstice Host Manager, directories for diskless clients are created by constructing names derived from a concatenation of the values of PRODNAME, PRODVERS, and client architecture, for example, /export/exec/Solaris_2.x_sparc.all/usr/platform. The length of the component containing the product name and version must not exceed 256 ASCII characters. Thus, for products corresponding to bundled OS releases (for example, Solaris 2.4), the values of PRODNAME and PRODVERS are effectively restricted to lengths much less than 256. The initial install programs use the value of the PRODDIR macro in the .cdtoc file to indicate where packages can be found. EXAMPLES
Example 1: Sample of .cdtoc file. Here is a sample .cdtoc file: # # .cdtoc file -- Online product family CD # PRODNAME=Online DiskSuite PRODVERS=2.0 PRODDIR=Online_DiskSuite_2.0 # PRODNAME=Online Backup PRODVERS=2.0 PRODDIR=Online_Backup_2.0 This example corresponds to the following directory layout on a CD-ROM partition: /.cdtoc /Online_DiskSuite_2.0 ./SUNWmddr.c ./SUNWmddr.m ./SUNWmddu /Online_Backup_2.0 ./SUNWhsm The bundled release of Solaris 2.6 includes the following .cdtoc file: PRODNAME=Solaris PRODVERS=2.6 PRODDIR=Solaris_2.6/Product This file corresponds to the following directory layout on slice 0 of the Solaris 2.6 product CD: /.cdtoc /Solaris_2.6/Product ./SUNWaccr ./SUNWaccu ./SUNWadmap . . . ./SUNWutool SEE ALSO
clustertoc(4), packagetoc(4), pkginfo(4) SunOS 5.10 14 Sept 2004 cdtoc(4)
All times are GMT -4. The time now is 11:30 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy