IGUANA: How to accept file (parse text file) and invoke web service? - iguana-ui

I am currently using Iguana tool. I know how to parse the csv/txt files by adding Source: From Translator and Destination: To translator. The code below has been edited in Destination script.
Parse a comma separated CSV file
local Csv = csv.parseCsv(Data) -- comma separated (default)
Parse a tab separated file
--local Csv = csv.parseCsv(Data, '\t') -- tab separated (sample message 11)
Parse a bar "|" separated file
--local Csv = csv.parseCsv(Data, '|') -- bar separated (sample message 12)
trace(CSV)
I don't know how to invoke web service. Do I need to create a separate channel for invoking web service and parsing a file? If so, how can I run it?

Related

How can we use "ls" command for appending file list from FTP to local file?

I'm using the command ls *Pattern*Date* Files.txt to get a list of files from FTP to my local text file.
I'm now required to get multiple patterned files (The Date and Pattern may come in different order). So when I try to add another line ls *Date*Pattern* Files.txt, this clears the FCCfiles.txt and I'm not able to get the first set of files.
Is there any command that can append the list of files rather than creating new files list?
You cannot append the listing to a file with ftp.
But you can merge multiple listings in PowerShell. I assume that you run ftp from PowerShell, based on your use of powershell tag.
In ftp script do:
ls *Pattern*Date* files1.txt
ls *Date*Pattern* files2.txt
And then in PowerShell do:
Get-Content files1.txt,files2.txt | Set-Content files.txt
(based on How do I concatenate two text files in PowerShell?)

pyspark - capture malformed JSON file name after load fails with FAILFAST option

To detect malformed/corrupt/incomplete JSON file, I have used FAILFAST option so that process fails. How do I capture corrupted file name out of 100s files because I need to remove that file from the path and copy good version of file from s3 bucket?
df = spark_session.read.json(table.load_path, mode='FAILFAST').cache()

Can we give two files as input while using JasperStarter

I am using JasperStarter to create pdf from several jrprint files and then print it using JasperStarter functtions.
I want to create one single pdf file with all the .jrprint files.
If I give command like:
jasperstarter pr a.jprint b.jprint -f pdf -o rep
It does not recognise the files after the first input file.
Can we create one single output file with many input jasper/jrprint files?
Please help.
Thanks,
Oshin
Looking at the documentation, this is not possible:
The command process (pr)
The command process is for processing a report.
In direct comparison to the command for compiling:
The command compile (cp)
The command compile is for compiling one report or all reports in a directory.

Tool to handle the errors in the error log file

We are developing a script in perl which when gives the url and the webserver to hit. It hits the url given in the webserver and gives the html content of the page.
For example :
perl scribehtml.pl --server servername --port portnumber --url /home/firstpage/index.php
This returns the entire html code of the page.
Now we are grepping the errors from the html code and write in a text file. Say when we see a text like 'Internal server error' we will put the entire html code into the text file.
There by we are going to have a error.txt where all the errors for different urls will be stored when we execute the script.
Now my Questions are :
How to make the error.txt into some log file say error.log and what are things i need to do to make a proper structure log file.
Is there any tool in which if we specify the log file it will parse the error in it and display the count of occurrence of each error in the log file in the dashboard.
As for us now I m storing the list of around 500 urls in a text file and parsing the it one by one and executing so there by i am getting error for the urls which are failing and I m writing those errors in the text file error.txt
Ideally you can make your own subroutine to store the logs in to the .log file.
The default structure for the log file is as following:
[Timestamp]:Error/Warning/Info: String to define the issue
You can format the lines using printf.

Perl script to Hyperlink to open a file based on the name of the file in each cell

I had developed a perl script to look for matching strings from text files and copied it into a spread sheet, I had also included the text file name into the spreadsheet for corresponding matching string. Now I want to hyperlink to open the file by clicking the file name in each cell.
Any help would be much appreciated! I'm not much of a programmer... Thanks!
Here is some examples by using the Spreadsheet::WriteExcel
# External link to a local file
$worksheet->write('B2', 'external:Italy.xls');
# External link to a local file with worksheet
$worksheet->write('B3', 'external:Italy.xls#Sales!B3');
# External link to a local file with worksheet and alternative string
$worksheet->write('B4', 'external:Italy.xls#Sales!B4', 'Link');
# External link to a local file with worksheet and format
$worksheet->write('B5', 'external:Italy.xls#Sales!B5', $format);
# External link to a remote file, absolute path
$worksheet->write('B6', 'external:c:/Temp/Asia/China.xls');
# External link to a remote file, relative path
$worksheet->write('B7', 'external:../Asia/China.xls');
# External link to a remote file with worksheet
$worksheet->write('B8', 'external:c:/Temp/Asia/China.xls#Sales!B8');
# External link to a remote file with worksheet (with spaces in the name)
$worksheet->write('B9', q{external:c:/Temp/Asia/China.xls#'Product Data'!B9});
You can see the write API for more information.