Sponsored Content
Top Forums Shell Programming and Scripting Reading each item from a formatted file Post 302410902 by Franklin52 on Wednesday 7th of April 2010 06:15:17 AM
Old 04-07-2010
Something like this:
Code:
while read column1 column2 column3
do
 # do something with $column1
 # do something with $column2
 # do something with $column3
 .
 .
done <  tempFile

 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Printing Formatted Records From A File

Hi All, I'm writing a script that provides a menu to manipulate records. I'm having a problem, however. The first option I'm writing is simply to display all of the records in a supplied file. The supplied file ('records') currently contains sample data, this data is: ... (3 Replies)
Discussion started by: Silentwolf
3 Replies

2. Shell Programming and Scripting

Searching for file and stopping at first item found

Hello, I try to write a shell script that would list all files on a directory and stop when it finds the first item specified on a find or ls command. How can I tell to the find or ls command to stop when it finds the first ".doc" file for example ? Thank you (7 Replies)
Discussion started by: davchris
7 Replies

3. Shell Programming and Scripting

Print new item in file with symbol

Dear all, I have encountered some problem here. I prompt the user for input and store it into a data file, eg. key in name and marks so the data file will look like this andrew 80 ben 75 and the next input is carine 90. So the problem here is i want to print... (2 Replies)
Discussion started by: branred
2 Replies

4. Shell Programming and Scripting

Extract information from Log file formatted

Good evening! Trying to make a shell script to parse log file and show only required information. log file has 44 fields and alot of lines, each columns separated by ":". log file is like: first_1:3:4:5:6:1:3:4:5:something:notinterested second_2:3:4:3:4:2 first_1:3:4:6:6:7:8 I am interested... (3 Replies)
Discussion started by: dummie55
3 Replies

5. Shell Programming and Scripting

Mail a formatted csv file

I have the below script i am getting the csv in garbled format.Please suggest the changes. SUNOS ####################################################################### ####MAIN SCRIPT ####################################################################### today=`date "+%m-%d-%Y ... (3 Replies)
Discussion started by: rafa_fed2
3 Replies

6. Shell Programming and Scripting

awk operation to get table formatted file

I need to parse .conf file in Unix system to get output from the snippets like below : ; generated by mod_identity exten => int,1,GoSub(mdc_template-3,s,1) exten => int,n(next_380),Return() ; default action for busy exten => ext,1,GoSub(mdc_template-3,s,1) exten => ext,n,Set(PRI_CAUSE=17)... (2 Replies)
Discussion started by: cheecky
2 Replies

7. Shell Programming and Scripting

Read a lis, find items in a file from the list, change each item

Hello, I have some tab delimited text data, file: final_temp1 aname val NAME;r'(1,) 3.28584 r'(2,)<tab> NAME;r'(3,) 6.13003 NAME;r'(4,) 4.18037 r'(5,)<tab> You can see that the data is incomplete in some cases. There is a trailing tab after the first column for each incomplete row. I... (2 Replies)
Discussion started by: LMHmedchem
2 Replies

8. UNIX for Beginners Questions & Answers

Zabbix item for last line of a log file

Dear all,Zabbix version : 2.4 (yes, I know, upgrading soon - honest) Server OS version : CentOS 6, 64-bit (CentOS 7 with the Zabbix upgrade)I've got a large log file that I would like to read by an external process. It's basically the same as reading the item value on a web-page. I have... (5 Replies)
Discussion started by: rbatte1
5 Replies

9. Shell Programming and Scripting

Processing a formatted file with awk

Hi - I want to interrogate information about my poker hands, sessions are all recorded in a text file in a particular format. Each hand starts with the string <PokerStars> followed by a unique hand reference and other data like date/time. There is then all the information about each hand. My first... (5 Replies)
Discussion started by: rbeech23
5 Replies

10. Shell Programming and Scripting

Script to process a list of items and uncomment lines with that item in a second file

Hello, I have a src code file where I need to uncomment many lines. The lines I need to uncomment look like, C CALL l_r(DESNAME,DESOUT, 'Gmax', ESH(10), NO_APP, JJ) The comment is the "C" in the first column. This needs to be deleted so that there are 6 spaces preceding "CALL".... (7 Replies)
Discussion started by: LMHmedchem
7 Replies
ORLite::Mirror(3pm)					User Contributed Perl Documentation				       ORLite::Mirror(3pm)

NAME
ORLite::Mirror - Extend ORLite to support remote SQLite databases SYNOPSIS
# Regular ORLite on a readonly SQLite database use ORLite 'path/mydb.sqlite'; # The equivalent for a remote (optionally compressed) SQLite database use ORLite::Mirror 'http://myserver/path/mydb.sqlite.gz'; # All available additional options specified use ORLite::Mirror { url => 'http://myserver/path/mydb.sqlite.gz', maxage => 3600, show_progress => 1, env_proxy => 1, prune => 1, index => [ 'table1.column1', 'table1.column2', ], }; DESCRIPTION
ORLite provides a readonly ORM API when it loads a readonly SQLite database from your local system. By combining this capability with LWP, ORLite::Mirror goes one step better and allows you to load a SQLite database from any arbitrary URI in readonly form as well. As demonstrated in the synopsis above, you using ORLite::Mirror in the same way, but provide a URL instead of a file name. If the URL explicitly ends with a '.gz' or '.bz2' then ORLite::Mirror will decompress the file before loading it. OPTIONS
ORLite::Mirror adds an extensive set of options to those provided by the underlying ORLite library. url The compulsory "url" parameter should be a string containing the remote location of the SQLite database we will be mirroring. ORLite::Mirror supports downloading the database compressed, and then transparently decompressing the file locally. Compression support is controlled by the extension on the remote database. The extensions ".gz" (for gunzip) and ".bz2" (for bunzip2) are currently supported. maxage The optional "maxage" parameter controls how often ORLite::Mirror should check the remote server to see if the data has been updated. This allows programs using the database to start quickly the majority of the time, but continue to receive automatic updates periodically. The value is the number of integer seconds we should avoid checking the remote server for. The default is 86400 seconds (one 24 hour day). show_progress The optional "show_progress" parameter will be passed through to the underlying LWP::UserAgent that will fetch the remote database file. When set to true, it causes a progress bar to be displayed on the terminal as the database file is downloaded. env_proxy The optional "env_proxy" parameter will be passed through to the underlying LWP::UserAgent that will fetch the remote database file. When set to true, it causes LWP::UserAgent to read the location of a proxy server from the environment. prune The optional "prune" parameter should be used when the surrounding program wants to avoid leaving files on the host system. It causes any files or directories created during the operation of ORLite::Mirror to be deleted on program exit at "END"-time. index One challenge when distributing SQLite database is the quantity of data store on disk to support the indexes on your database. For a moderately indexed database where all primary and foreign key columns have indexes, the amount of data in the indexes can be nearly as large as the data stored for the tables themselves. Because each user of the database module will be interested in different things, the indexes that the original creator chooses to place on the database may not even be used at all and other valuable indexes may not exist at all. To allow sufficiently flexibility, we recommend that SQLite database be distributed without any indexes. This greatly reduces the file size and download time for the database file. The optional "index" parameter should then be used by each different consumer of that module to index just the columns that are of specific interest and will be used in the queries that will be run on the database. The value should be set to an "ARRAY" reference containing a list of column names in "tablename.columnname" form. index => [ 'table1.column1', 'table1.column2', ], SUPPORT
Bugs should be reported via the CPAN bug tracker at http://rt.cpan.org/NoAuth/ReportBug.html?Queue=ORLite-Mirror <http://rt.cpan.org/NoAuth/ReportBug.html?Queue=ORLite-Mirror> For other issues, contact the author. AUTHOR
Adam Kennedy <adamk@cpan.org> COPYRIGHT
Copyright 2008 - 2012 Adam Kennedy. This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself. The full text of the license can be found in the LICENSE file included with this module. perl v5.14.2 2012-02-02 ORLite::Mirror(3pm)
All times are GMT -4. The time now is 06:10 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy