Sponsored Content
Top Forums Shell Programming and Scripting perl: Read array from a flat file Post 302575500 by Pratik4891 on Tuesday 22nd of November 2011 01:17:52 AM
Old 11-22-2011
Guys ,

Thanks a lot for replying .I know the requirement is weird

The point is after sorting two files I have to compare files to each other

Is there any way I can do like this

Code:
 
open my $fh1, '<', @sorted or die "Can't open $file1: $!";

I have to do the following

Code:
 
while (<$fh1>){ 
chomp; 
my @rec = split /\|/; 
my $key = $rec[2]; 
$save{$key}->{'data'} = $_; #Save current record in hash 
$save{$key}->{'flag'} = 'D';
}

so I need to read the sorted array into $fh1

Thanks a lot for your support
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

How to read lines from a flat file

i have some commands written line by line in one flat file i have to read each linefrom this file(file name passed as parameter) and then i have to execute this How can i do it? (2 Replies)
Discussion started by: bihani4u
2 Replies

2. Shell Programming and Scripting

Perl: Read directories and assign to array

I would like to read directories and assign to an array where the user can select a directory from the output. For example, a dir list will populate with a number assigned to each dir. I would like to ask the user to select the dir they want. TIA, I don't know what this would be called so I... (2 Replies)
Discussion started by: man
2 Replies

3. Shell Programming and Scripting

how to read fixed length flat file....

Hi Gurus, Thanks in advance... I am new to writing shell scripting and help me out reading a flat file with fixed length. I have a fixed length flat file with storename(lenth 6) , emailaddress(lenth 15), location(10). There is NO delimiters in that file. Like the following str00001.txt... (2 Replies)
Discussion started by: willywilly
2 Replies

4. Shell Programming and Scripting

How to read the first column in a flat file with ~ as delimiter

I have one flat file like below id1~col~batch1 id2~col2~batch2 id3~col3~batch3 I need to read the first column one by one and I need to write one db2 query based on that column1 Like for (i=0;i<=10;i++) do insert into table column (con_id) values (select column from table where... (4 Replies)
Discussion started by: siri_886
4 Replies

5. Shell Programming and Scripting

To read a flat file containing XML data

I have a file something like this:aaaa.xml content of the file is 0,<?xml version="1.0" encoding="UTF-8" standalone="yes"?> <storeInformation xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> <s> <BRANCH_NO>3061</BRANCH_NO> <BRANCH_NAME>GREEN EXPRESS</BRANCH_NAME> ... (4 Replies)
Discussion started by: kmanivan82
4 Replies

6. Shell Programming and Scripting

PERL : Read an array and write to another array with intial string pattern checks

I have an array and two variables as below, I need to check if $datevar is present in $filename. If so, i need to replace $filename with the values in the array. I need the output inside an ARRAY How can this be done. Any help will be appreciated. Thanks in advance. (2 Replies)
Discussion started by: irudayaraj
2 Replies

7. Shell Programming and Scripting

Read flat file upto certain number of columns

Hello Guys Please help me with the below issue I want to read a flat file source upto certain number of columns Say my flat file has 30 columns but I want to read upto 25 columns only How come the above issue can be addressed? Thanks a lot!!!! (1 Reply)
Discussion started by: Pratik4891
1 Replies

8. Shell Programming and Scripting

Read from Multiple character delimited flat file

Hello Guys I have a multiple character delimited flat file "|~|". when I tried to read the data the "|" character also coming Example I/P file 9882590|~|20111207|~|K03501000063005574033961|~|K|~| Command to get the second column I used awk -F"|~|" ' {print $2}' ... (2 Replies)
Discussion started by: Pratik4891
2 Replies

9. UNIX and Linux Applications

Perl Script to read an excel file into an array and search in the UNIX directories

Hi, I want the Perl script with versions 5.8.2 and 5.8.5 starting with #!/usr/bin/perl The Perl program should read the excel file or text file line by line and taking into an array and search in the UNIX directories for reference file of .jsp or .js or .xsl with path .The Object names... (2 Replies)
Discussion started by: pasam
2 Replies

10. OS X (Apple)

Create a bash array from a flat file of whitespaces only.

Hi guys and gals... MacBook Pro. OSX 10.13.2, default bash terminal. I have a flat file 1920 bytes in size of whitespaces only. I need to put every single whitespace character into a bash array cell. Below are two methods that work, but both are seriously ugly. The first one requires that I... (7 Replies)
Discussion started by: wisecracker
7 Replies
roarvio(7)						System Manager's Manual: RoarAuido						roarvio(7)

NAME
libroar - RoarAudio sound library roarvio - RoarAudio virtual IO layer SYNOPSIS
#include <roaraudio.h> struct roar_vio_calls; DESCRIPTION
The RoarAudio VIO interface is RoarAudio's IO abstraction layer. It provides basic IO functions such as read and write independing on the underlaying IO. For Example can you open a plain or a gziped file via the VIO layer. After a successful open both objects behave the same, libroar takes care about the compression in the gzip case. TUTORIALS
Tutorials can be found in roartutvio(7). IMPORTANT FUNCTIONS
There are several important functions. This is a small list of the most important ones. Opening roar_vio_open_file(3), roar_vio_open_fh(3), roar_vio_open_stdio(3), roar_vio_open_dstr(3), roar_vio_open_proto(3). While there are a lot functions important for opening files the most important one is roar_vio_open_dstr(3). It opens a stream based on URLs that can point to local files or files on remote machines. It also can handle compression and encryption. Closing roar_vio_close(3), roar_vio_shutdown(3) Reading and writing roar_vio_read(3), roar_vio_write(3) Seeking and positioning roar_vio_lseek(3) Non-Blocking and Asyncron IO roar_vio_nonblock(3), roar_vio_sync(3), roar_vio_select(3) Networking and Sockets roar_vio_accept(3) String handling roar_vio_printf(3) BUGS
A lot... SEE ALSO
roar-config(1), roartypes(1), roartutvio(7), RoarAudio(7). RoarAudio May 2011 roarvio(7)
All times are GMT -4. The time now is 05:12 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy