Sponsored Content
Top Forums UNIX for Dummies Questions & Answers Set variables from fields in fields Post 302558741 by Scrutinizer on Sunday 25th of September 2011 06:32:30 AM
Old 09-25-2011
Or in shell:
Code:
while IFS=: read title htmlfile; do
  echo "The name of the file is $htmlfile and the title is $title."
done < infile

 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

awk sed cut? to rearrange random number of fields into 3 fields

I'm working on formatting some attendance data to meet a vendors requirements to upload to their system. With some help on the forums here, I have the data close. But they've since changed what they want. The vendor wants me to submit three fields to them. Field 1 is the studentid field,... (4 Replies)
Discussion started by: axo959
4 Replies

2. Shell Programming and Scripting

Add fields in different files only if some fields between them match

Hi everybody (first time posting here) I have a file1 that looks like > 1,101,0.1,0.1 1,26,0.1,0.1 1,3,0.1,0.1 1,97,0.5,0.5 1,98,8.1,0.218919 1,99,6.2,0.248 2,101,0.1,0.1 2,24,3.1,0.147619 2,25,23.5,0.559524 2,26,34,0.723404with 762 lines.. I have another 'similar' file2 > ... (10 Replies)
Discussion started by: murpholinox
10 Replies

3. Shell Programming and Scripting

Assigning fields values to different variables

Hi, I have this code: cat file.txt | awk -F, 'NR==1{print $6","$8","$10","$20","$21","$19}' > file.tmp VAR1=`cat file.tmp | cut -d "," -f1` VAR2=`cat file.tmp | cut -d "," -f2` VAR3=`cat file.tmp | cut -d "," -f3`; VAR4=`cat file.tmp | cut -d "," -f4`; VAR5=`cat... (1 Reply)
Discussion started by: Tr0cken
1 Replies

4. Shell Programming and Scripting

awk question ? set 2 variables by matching fields

Hello, I'm trying to get the TOP and BASE numbers printed out File looks like this: 2300 CAR # 2300 is the TOP 2310 CAR 2335 CAR 2455 CAR # 2455 is the BASE 1000 MOTOR # 2455 will become this TOP 2000 MOTOR 3000 MOTOR 4000 MOTOR # 4000 is the BASE 2345 BIKE # 4000... (8 Replies)
Discussion started by: charlieglen
8 Replies

5. Shell Programming and Scripting

How to print 1st field and last 2 fields together and the rest of the fields after it using awk?

Hi experts, I need to print the first field first then last two fields should come next and then i need to print rest of the fields. Input : a1,abc,jsd,fhf,fkk,b1,b2 a2,acb,dfg,ghj,b3,c4 a3,djf,wdjg,fkg,dff,ggk,d4,d5 Expected output: a1,b1,b2,abc,jsd,fhf,fkk... (6 Replies)
Discussion started by: 100bees
6 Replies

6. Shell Programming and Scripting

awk - compare 1st 15 fields of record with 20 fields

I'm trying to compare 2 files for differences in a selct number of fields. When differnces are found it will write the whole record of the second file including appending '|C' out to a delta file. Each record will have 20 fields, but only want to do comparison of 1st 15 fields. The 1st field of... (7 Replies)
Discussion started by: sljnk
7 Replies

7. Shell Programming and Scripting

awk sort based on difference of fields and print all fields

Hi I have a file as below <field1> <field2> <field3> ... <field_num1> <field_num2> Trying to sort based on difference of <field_num1> and <field_num2> in desceding order and print all fields. I tried this and it doesn't sort on the difference field .. Appreciate your help. cat... (9 Replies)
Discussion started by: newstart
9 Replies

8. Shell Programming and Scripting

Parsing fields into variables

A record contains 50 fields separated by "~". I need to assign each of these fields to different variables. Following is the shell script approach I tried. RECORD="FIELD1~FIELD2~FIELD3~FIELD4~FIELD5~...........~FIELD50" VAR1=$(echo ${RECORD} | cut -d"~" -f 1) VAR2=$(echo ${RECORD} | cut... (5 Replies)
Discussion started by: krishmaths
5 Replies

9. Shell Programming and Scripting

Print . in blank fields to prevent fields from shifting

The below code works great, kindly provided by @Don Cragun, the lines in bold print the current output. Since some of the fields printed can be blank some of the fields are shifted. I can not seem too add . to the blank fields like in the desired output. Basically, if there is nothing in the field... (10 Replies)
Discussion started by: cmccabe
10 Replies

10. UNIX for Beginners Questions & Answers

Is there a UNIX command that can compare fields of files with differing number of fields?

Hi, Below are the sample files. x.txt is from an Excel file that is a list of users from Windows and y.txt is a list of database account. $ head -500 x.txt y.txt ==> x.txt <== TEST01 APP_USER_PROFILE USER03 APP_USER_PROFILE TEST02 APP_USER_EXP_PROFILE TEST04 APP_USER_PROFILE USER01 ... (3 Replies)
Discussion started by: newbie_01
3 Replies
DEBBUGSCONFIG(8)					      System Manager's Manual						  DEBBUGSCONFIG(8)

NAME
debbugsconfig - copy basic debbugs configuration files from templates SYNOPSIS
debbugsconfig DESCRIPTION
debbugsconfig will copy basic debbugs configuration files from templates if the files do not already exist, and will also create BTS user documentation in HTML and text. It should be run on installation and whenever /etc/debbugs/config or /etc/debbugs/text are changed. FILES
debbugsconfig creates the following template configuration files in $gConfigDir (/etc/debbugs by default): config General debbugs configuration file. text Longer messages output by debbugs. Maintainers Index of maintainers for each package. This will typically be automatically generated. Maintainers.override Manual overrides for the maintainer index. pseudo-packages.description Descriptions of any entries in the system's maintainer index that do not correspond to "real" packages. For example, the Debian Project uses pseudo-packages for bugs against facilities such as the Debian web site, the mailing list archives, and the bug tracking system itself. sources Index of source packages corresponding to each package. This may be used when several packages are produced from a single source, in which case the bug tracking system will group them together with links in the web front-end. debbugsconfig creates the following template state files in $gSpoolDir (/var/lib/debbugs/spool by default): nextnumber The file which records the tracking number that will be assigned to the next incoming bug report. index.archive.realtime Real-time index of archived bugs. Created empty. index.db.realtime Real-time index of non-archived bugs. Created empty. debbugsconfig creates the following documents in $gWebDir (/var/lib/debbugs/www by default): index.html Main contents page. Access.html, bug-log-access.txt Description of how to access bug reports. Reporting.html, bug-reporting.txt Advice on reporting bugs. server-control.html, bug-maint-mailcontrol.txt Introduction to the bug control and manipulation mail server. server-refcard.html, bug-mailserver-refcard.txt Mail servers' reference card. server-request.html, bug-log-mailserver.txt Introduction to the bug system request server. AUTHORS
debbugsconfig was originally written by Darren Benham and later rewritten by Josip Rodin. Colin Watson wrote this man page. DEBBUGSCONFIG(8)
All times are GMT -4. The time now is 09:39 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy