Sponsored Content
Full Discussion: chop a data file into rows
Top Forums Shell Programming and Scripting chop a data file into rows Post 302086778 by pau on Sunday 27th of August 2006 03:03:53 PM
Old 08-27-2006
I wanto to firstly plot the Splotch4_0010_part.asc and then immediately the _b_ corresponding I created thanks to your script, Splotch4_0010_part_b.asc

So that it should be something like

Code:
for f in Splotch4_*_part.asc and g in Splotch4_*_part_b.asc ; do
  eps_file=`basename $f .asc.gz`.eps

  gnuplot <<EOF
    unset key
    set xrange [-15:15]
    set yrange [-15:15]
    set xlabel "X (pc)" font "Helvetica,12"
    set ylabel "Y (pc)" font "Helvetica,12"
    set terminal postscript eps enhanced ; set output "$eps_file"
    set pointsize 1
    plot "< zcat $f" using 3:4 with dots lt 8, plot "< zcat $g" using 3:4 with points pt 6 lt -1
    unset output
EOF
done

where $f are my files and $g the companion files created with your script

I don't know how to define a second variable in the "for" block Smilie

Of course the dark red comment is wrong, but I guess you get the idea
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

chomp and chop in perl

What is the differnece between chomp and chop in perl? (1 Reply)
Discussion started by: seismic_willy
1 Replies

2. Shell Programming and Scripting

Need to Chop Header and Footer record from input file

Hi, I need to chope the header and footer record from an input file and make a new output file, please let me know how i can do it in unix.thanks. (4 Replies)
Discussion started by: coolbudy
4 Replies

3. UNIX for Dummies Questions & Answers

Search for & edit rows & columns in data file and pipe

Dear unix gurus, I have a data file with header information about a subject and also 3 columns of n rows of data on various items he owns. The data file looks something like this: adam peter blah blah blah blah blah blah car 01 30 200 02 31 400 03 57 121 .. .. .. .. .. .. n y... (8 Replies)
Discussion started by: tintin72
8 Replies

4. Shell Programming and Scripting

how to add if data in rows

Hi Friends, How to add if data is in different rows. Input: 1;20091102;20170930;-9.00;| 1;20091026;20170930;-2.00;| 1;20100720;20170930;-25.00;| 1;20090901;20211227;-10.00;| Output 9+2+25+10 = 46 Thx Suresh (4 Replies)
Discussion started by: suresh3566
4 Replies

5. Shell Programming and Scripting

How to insert/expand data/rows in a file, with rules??

Hi, I am rather new to Unix/Linus. I have this problem that I would like to solve using unix. Here is what I have start stop expression 1 5 15 2 6 10 I want a output like this position expression 1 15 2 25 3 ... (3 Replies)
Discussion started by: wanghlv
3 Replies

6. UNIX for Dummies Questions & Answers

Suggestion to convert data in rows to data in columns

Hello everyone! I have a huge dataset looking like this: nameX nameX 0 1 2 2 2 2 2 2 2 2 2 2 2 2 1 2 2 2 1 2 2 2 ............... nameY nameY 2 2 2 2 2 2 2 2 2 2 1 2 2 2 1 2 2 2 ..... nameB nameB 0 1 2 2 2 2 2 2 2 2 1 2 2 2 1 2 2 2 ..... (can be several thousands of codes) and I need... (8 Replies)
Discussion started by: kush
8 Replies

7. UNIX for Dummies Questions & Answers

Merge rows in bid data file

Dear all, Please help me ,,,, if I have input file like this A_AA960715 leucine-rich repeat-containing protein GO:0006952 defense response P A_AA960715 leucine-rich repeat-containing protein GO:0008152 metabolic process P A_AA960715 leucine-rich... (5 Replies)
Discussion started by: AAWT
5 Replies

8. UNIX for Dummies Questions & Answers

merging rows into new file based on rows and first column

I have 2 files, file01= 7 columns, row unknown (but few) file02= 7 columns, row unknown (but many) now I want to create an output with the first field that is shared in both of them and then subtract the results from the rest of the fields and print there e.g. file 01 James|0|50|25|10|50|30... (1 Reply)
Discussion started by: A-V
1 Replies

9. Shell Programming and Scripting

Moving or copying first rows and last rows into another file

Hi I would like to move the first 1000 rows of my file into an output file and then move the last 1000 rows into another output file. Any help would be great Thanks (6 Replies)
Discussion started by: kylle345
6 Replies

10. Shell Programming and Scripting

How to remove new line characters from data rows in a Pipe delimited file?

I have a file as below Emp1|FirstName|MiddleName|LastName|Address|Pincode|PhoneNumber 1234|FirstName1|MiddleName2|LastName3| Add1 || ADD2|123|000000000 2345|FirstName2|MiddleName3|LastName4| Add1 || ADD2| 234|000000000 OUTPUT : ... (1 Reply)
Discussion started by: styris
1 Replies
ETHER_ATON(3)						     Linux Programmer's Manual						     ETHER_ATON(3)

NAME
ether_aton, ether_ntoa, ether_ntohost, ether_hosttonn, ether_line, ether_ntoa_r, ether_aton_r - Ethernet address manipulation routines SYNOPSIS
#include <netinet/ether.h> char * ether_ntoa(const struct ether_addr *addr); struct ether_addr * ether_aton(const char *asc); int ether_ntohost(char *hostname, const struct ether_addr *addr); int ether_hostton(const char *hostname, struct ether_addr *addr); int ether_line(const char *line, struct ether_addr *addr, char *hostname); /* GNU extensions */ char * ether_ntoa_r(const struct ether_addr *addr, char *buf); struct ether_addr * ether_aton_r(const char *asc, struct ether_addr *addr); DESCRIPTION
ether_aton() converts the 48-bit Ethernet host address asc from the standard hex-digits-and-colons notation into binary data in network byte order and returns a pointer to it in a statically allocated buffer, which subsequent calls will overwrite. ether_aton returns NULL if the address is invalid. The ether_ntoa() function converts the Ethernet host address addr given in network byte order to a string in standard hex-digits-and-colons notation, omitting leading zeroes. The string is returned in a statically allocated buffer, which subsequent calls will overwrite. The ether_ntohost() function maps an Ethernet address to the corresponding hostname in /etc/ethers and returns non-zero if it cannot be found. The ether_hostton() function maps a hostname to the corresponding Ethernet address in /etc/ethers and returns non-zero if it cannot be found. The ether_line() function parses a line in /etc/ethers format (ethernet address followed by whitespace followed by hostname; '#' introduces a comment) and returns an address and hostname pair, or non-zero if it cannot be parsed. The buffer pointed at by hostname must be suffi- ciently long, e.g., have the same length as line. The functions ether_ntoa_r and ether_aton_r are re-entrant threadsafe versions of ether_ntoa and ether_aton respectively, and do not use static buffers. The structure ether_addr is defined in net/ethernet.h as: struct ether_addr { u_int8_t ether_addr_octet[6]; } BUGS
The glibc 2.2.5 implementation of ether_line() is broken. CONFORMING TO
BSD 4.3, SunOS SEE ALSO
ethers(5) BSD
2002-07-20 ETHER_ATON(3)
All times are GMT -4. The time now is 10:14 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy