Longhand using OSX 10.7.5, default bash terminal.
Results:-
Important note:- eval is a very powerful and dangerous command; be aware!
EDIT:
15th July 2014, 13:11pm local UK time; now tested on CygWin...
Last edited by wisecracker; 07-15-2014 at 09:12 AM..
Reason: See above...
I need to read a file (a list) and assign the value to a variable (for each line), I'm looping until the end of the file. My problem is, I want to assign 2 separate variables from the list. The process I'm using is:
awk '{print $3}' file1 > file2
awk '{print $4}' file1 > file3
cat file2... (2 Replies)
Hi,
I have a bash script that accepts some parameters as input, like:
sh script.sh first second third .....
I want to save these parameters as different variables, something like:
VAR1=first
VAR2=second
etc
I tried this, but apparently it didn't worked....... (16 Replies)
Hello,
I have a paramter $param consisting just of two literals and want to split it into two parameters, so I can combine it to a new parameter <char1><string><char2>, but the following code didn't work:
tmp_PARAM_1=cut -c1 $PARAM
tmp_PARAM_2=cut -c2 $PARAM... (2 Replies)
Hi,
I have a file like the following...
CUST=
DIR=
NULIST=
name=philps_123
How can i add values to each of these unassigned variables using a shell script?
say for eg: i have values for CUST as onida, dir as /dir/onida, NULIST as /tmp/onida_files. How can i add these values to... (11 Replies)
Hi ,I am trying to assign string to variable ,but it doesn't work
Also could you show me different ways to use grep,(I am trying to get the first,second and first column form file,and I am counting the chars)
let name=`grep "$id" product | cut -c6-20` (25 Replies)
Hello
I have a text file with the next pattern
Name,Year,Grade1,Grade2,Grade3
Name,Year,Grade1,Grade2,Grade3
Name,Year,Grade1,Grade2,Grade3
I want to assign to external variables the grades using the awk method.
After i read the file line by line in order to get the grades i use this
... (2 Replies)
How can I read a string delimited on spaces and assign the fields to incremented variables.
For example:
Given $exts= txt dat mov
I want to read in $exts and have "txt" "dat" and "mov" assigned to incremented variables like $ext1, $ext2, etc. I would like to do this in a loop so that I can... (4 Replies)
Hi guys,
I'm currently writing a script for automating a FreeBSD ZFS setup (ZFSonRooT). I got stuck at one point for raidz(1,2 a.k.a raid5,6) and am in need of assistance.
This is what I need. example:
#!/bin/sh <- must stay sh
echo -n "hdd list: "
read hdd_list
echo -n "hdd label list:... (2 Replies)
i have a program that spits out a certain number of values. i dont know the number of values. they can be 4, 10, 7, 20, no idea.
but, i want to be able to assign each of the value returned by this program to a variable.
in the latest instance, the program gave the following 6 values:
4... (8 Replies)
Hi all,
i have a .csv file with only two columns, like:
Login;Status
Luca;S
Marco;
Stefano;
Elettra;S
Laura;
...
I need to replace the blank space on Status column whit Enabled end, on the same column, S whit Disabled, like:
Login;Status
Luca;Disabled
Marco;Enabled
Stefano;Enabled... (10 Replies)
Discussion started by: kamose
10 Replies
LEARN ABOUT DEBIAN
image::exiftool::import
Image::ExifTool::Import(3pm) User Contributed Perl Documentation Image::ExifTool::Import(3pm)NAME
Image::ExifTool::Import - Import CSV and JSON database files
SYNOPSIS
use Image::ExifTool::Import qw(ReadCSV ReadJSON);
$err = ReadCSV($csvFile, \%database);
$err = ReadJSON($jsonfile, \%database);
DESCRIPTION
This module contains routines for importing tag information from CSV (Comma Separated Value) and JSON (JavaScript Object Notation) database
files.
EXPORTS
Exports nothing by default, but ReadCSV and ReadJSON may be exported.
METHODS
ReadCSV / ReadJSON
Read CSV or JSON file into a database hash.
Inputs:
0) CSV file name.
1) Hash reference for database object.
2) Optional flag to set '-' values to undef in the database. (Used for deleting tags.)
3) [ReadJSON only] Optional character set for converting Unicode escape sequences in strings. Defaults to "UTF8". See the ExifTool
Charset option for a list of valid settings.
Return Value:
These functions return an error string, or undef on success and populate the database hash with entries from the CSV or JSON file.
Entries are keyed based on the SourceFile column of the CSV or JSON information, and are stored as hash lookups of tag name/value for
each SourceFile.
AUTHOR
Copyright 2003-2011, Phil Harvey (phil at owl.phy.queensu.ca)
This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
SEE ALSO Image::ExifTool(3pm)perl v5.12.4 2011-03-12 Image::ExifTool::Import(3pm)