Parsing multi line files
All,
I have to parse a file that has multiple lines per client.
example:
ENTRY001 444444444 44444444444
ENTRY002 44 555555 66666
ENTRY003 6666 444 22222222
As you can see, each client spans multiple lines. I have to parse this data and create a client object.
So maybe on the 1st line the numbers equal an account number.
Not sure how I should approach this parse.
Also,
I have other files to parse as well. Should I make one big parser, and use config or just a build a parser for each filetype.
Using config files I dont like because the work/burden outway the benefit.
Your opinion please?
M : )
iketurna wrote:
I have other files to parse as well. Should I make one big parser, and use config or just a build a parser for each filetype.
Using config files I dont like because the work/burden outway the benefit.Not if you have multiple files to parse. You can either write a different parse class for each type of file that you need to parse, or you can write some config files. Personally I prefer to write good java code once and use the config files.
Similar Messages
-
Feature request : import of multi-line notes in CSV or tab-delimited file
This is a feature request to the AddressBook development team:
Following a question posted here and asked to support (thanks to Barry and Julia from ADC), it turns out that AddressBook is not ready yet to import multi-line notes from a CSV or tab-delimited file.
I would like to kindly suggest the AddressBook development team to update the import methods for such flat files to parse the text of what is assigned to the Notes field, and convert documented escape sequences to their pre-determined corresponding special character.
I would think that the following would be pretty easy to implement, and easy for the targeted audience (enthousiasts power-users and up) to remember:
"\n " : mark a new line (same as ^p in Word)
"\t " : replace by a tab
I would keep the trailing space to avoid problems with DOS-type file path problems.
and of course...
"\\n " and "\\t " for whoever would want to import notes about \n and \t
For example, in a Notes column, the text:
"Escape sequence \\n :\n move the text to a new line\n \n while escape sequence \\t :\t move the text to the next horizontal tab"
would give the following (just consider text between <Note> marks):
<Note>
Escape sequence \n:
move the text to a new line
while escape sequence \t: move the text to the next horizontal tab
</Note>
Thanks for reading...
Frédéric DenisThe developers do not necessarily read these USER discussion pages. If you want to make suggestions and know they will be read (which is at least a step towards implementation) use the OS X feedback page.
AK -
Reading a semi column delimited multi line Flat file on KM repository
Hi,
I have a requirement in our project to read a multi line, semi column delimited flat from kept on the Knowledge Management repository and display the contents in the Portal.
I had tried couple of options and was unable to read the file. I am not sure which are the correct APIs I should be using.
Can any one of the experts could guide me with the sample code, that will be great!
Your early response is highly appreciated.
Regards
Venkathere you go.
//******* Read file from KM
String repository_km;
String FileURL;
repository_km="/documents/data/data.txt";
try
//Getting the user......
IWDClientUser wdClientUser = WDClientUser.getCurrentUser();
IUser sapUser = wdClientUser.getSAPUser();
com.sapportals.portal.security.usermanagement.IUser ep5User =
WPUMFactory.getUserFactory().getEP5User(sapUser);
//Getting the Resource.........
IResourceContext resourseContext = new ResourceContext(ep5User);
IResourceFactory resourseFactory = ResourceFactory.getInstance();
//path to the KM Folder ("/documents/data/data.txt")
RID rid= RID.getRID(repository_km);
com.sapportals.wcm.repository.IResource resource =
resourseFactory.getResource(rid, resourseContext);
if (resource != null)
String text = "";
BufferedReader in = new BufferedReader(new InputStreamReader(resource.getContent().getInputStream()));
int count=0;
while ((text = in.readLine()) != null)
strText[count] =text;
count++;
catch (RuntimeException e2) {
wdComponentAPI.getMessageManager().reportException("Error in reading file from KM : "+e2.getMessage(),true);
// TODO Auto-generated catch block -
I am trying to add an motd banner to a configuration template in template center. When I add it I get the following error on the import:
Template import Failed. Unable to parse the XML file.Please ensure that the XML file is complaint to the schema.
I went to the config manual and copied the multi-line command example exactly as shown and added it to my template:
<MLTCMD> banner login "Welcome to
Cisco Prime LMS - you are using
Multi-line commands" </MLTCMD>
I still get the import error. I have never been able to get multi-line commands to work in any version of LMS. Is this a known issue? Is there a fix?
-JeffThe ability to import templates with multi-line support was not added until LMS 4.1. You also have to use < and > instead of < and > as the MLTCMD tag is embedded into XML and not part of the XML itself. Here's an example from the SCH template:
crypto ca authenticate cisco<R><MLTCMD>-----BEGIN CERTIFICATE-----
MIICPDCCAaUCEHC65B0Q2Sk0tjjKewPMur8wDQYJKoZIhvcNAQECBQAwXzELMAkGA1UEBh
MCVVMxFzAVBgNVBAoTDlZlcmlTaWduLCBJbmMuMTcwNQYDVQQLEy5DbGFzcyAzIFB1Ymxp
YyBQcmltYXJ5IENlcnRpZmljYXRpb24gQXV0aG9yaXR5MB4XDTk2MDEyOTAwMDAwMFoXD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N0eIsbfFrYrghQKlFzyUO
yvzv9iNw2tZdMGQVPtAhTItVgooazgW+yzf5VK+wPIrSbb5mZ4EkrZn0L74ZjmQoObj49n
JOhhGbXdzbULJgWOw27EyHW4Rs/iGAZeqa6ogZpHFt4MKGwlJ7net4RYxh84HqTEy2Y=
-----END CERTIFICATE-----
END OF INPUT</MLTCMD><R>yes -
Saving an array of multi-line text cells in a format that can be read in later
I can create an array of multi-line text entries that my program can then pick cells and compile them into a list of text.
I would like to be able to Save the array as a file, then change my program to read in the file.
If I use the Save Spreadsheet file vi, the data is corrupted by the carriage returns within the cells and the data read in is messed up.
Can someone recommend a way to save the array that preserves the carriage returns?As far as I know, this cannot be done automatically with the basic VIs from the palletes. I would convert the [LF] into another group of characters (likely "\n") and then save the text array to a CSV file. Don't forget to escape any good "\" string with an extra "\. Regular expressions would work really well:
Just make sure you parse your entire array of strings with this.
Olivier
Attachments:
SaveToCSV_WithMultiLine.vi 9 KB -
Setting hotspot to multi line text
In the AutoVue 2D(dwg) hotspot, one line text hotspot works well.
but i can't setting hotspot keyword is separated in two lines.
this keyword is founded when i find at Find Text dialog (Edit> Find Text menu)
so i think must be hotspot will work.
to set multi line hotspot, how do i set DEFINITION_REGEX.
or if multi line hotspot is not supported, how do i modify dwg files to work hotspot.Hotspot handler is looking inside each text record. If the lines belong to different records this will not work.
Try to set the regEx to any text (regEx=.*) and hover the mouse over the desired lines.
If both lines are not highlighted, this means that they belong to different records
Otherwise need to parse the selected lines and try to set the correct regEx. -
Permanently save line spacing in a multi-line text field
Me: Adobe Acrobat 8 Pro, Windows Vista
(I think the people who will be using the form have Reader 7 on Windows)
I work in a doctors' clinic, and we use phone message sheets to document conversations between the patients/us/nurses/doctors, and I scanned the form and made it into a fillable PDF for our secretaries to fill out more quickly. The "message" area has pre-printed lines on it, and the multi-line text field I placed there needs to match up to the lines. I used the Rich Text Formatting options to set it to "Exactly 24 Points," but I can't get it to KEEP the formatting permanently. The only way I could get it to save the formatting in that field was to put a space in it and then save it, and then give that to the 2 phone secretaries. It works perfectly the first time, but instead of just closing/re-opening the file to start a new message, one of the secretaries highlights everything in the "message" field and deletes it... which deletes the line spacing formatting. I've told her
b numerous
times to leave that starting space in the field, but she "forgets" so all of her messages look messed up. So is there a way to force that line spacing
b PERMANENTLY
???? Here's a shrunken screenshot of the field -- I wish I could just erase the lines altogether so the spacing wouldn't matter, but the secretaries type/print the message out, then the nurses/docs write on the page with pen so the lines have to stay. http://img187.imageshack.us/my.php?image=notepreviewph8.jpg
Thanks!You can set the font size of the text. Then play with the underlines in the original document to match the needs of the font that is used. Print to a new PDF and then use replace pages to put the new page into the form without changing the form fields. I was able to do this with a word processing document by adding underlining in the document with 12 pt and setting the font to 12 pt in the text field. You can play with the font, the border of the field, and the underlining in the original document to get the desired result. Is this optimal, probably not. However it does the job.
-
Address Book: Importing Multi-Line Fields
A common and often unavoidable import format for Mac Address Book is Comma Separated Value files (.csv). Address Book cannot import CSV files that have multi-line fields, such as might be included in Notes, because it cannot tolerate embedded newline characters (a.k.a., carriage returns, line breaks). (See http://docs.info.apple.com/article.html?path=AddressBook/4.0/en/ad808.html. The CSV spec (http://en.wikipedia.org/wiki/Comma-separated_values) addresses this need by requiring that fields which contain newlines be enclosed in quotes, but Address Book doesn't adhere to this part of the standard.)
Here's a way to import CSV files and have multi-line fields preserved:
Using an editor, replace +every embedded+ newline character in the CSV file with "\n". Take care to not alter the newline characters that end each record. Import the resulting file into Address Book using the CSV option. Selecting the 'Last Import' group, export those specific records using the vCard option. Then delete those records. Then import the vCards previously exported. Presto!
Apparently, although Address Book is blind to "\n" when importing CSV files, and exporting vCard fields, it interprets this character sequence as newline when importing vCards.Hi Adam,
Thanks, but the problem is not importing to AddressBook, it is exporting. I did discover from another that I can export very easily to a Numbers spreedsheet. It is exceptionally simple. But it will not export custom fields. Someone said that is because of a vcard standard. My custom fields are just "name" fields that I have labeled differently. But Numbers does not support the name (it only takes the name of the card).
Christine -
How to Remove the /Div in a Multi-line Field when reporting in Excel, getting
I am uisng Excel Services to extract data from PS2013. And the Multi-line text fields include the </Div> syntax. I have looked at a lot of the links regarding how to do this. I have even borrowed code that was on someones blog.
When I try and use it I get the following message and cannot not seem to resolve it after reading varous links regarding this issue.
Any ideas? As a work around I have created an Excel Macro to remove it, however would like to solve it in the query
Error Message
The data types
Nvarchar and Ntext are incompatible in the add operator
Here is the syntax
declare @Headxml nvarchar(350)
declare @Footxml nvarchar(50)
set @Headxml = N'<?xml version="1.0"?>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd"
[<!ENTITY nbsp " "><!ENTITY quot """>]><html><body>'
set @Footxml = N'</body></html>'
SELECT ProjectOwner.ProjectUID as [ProjectUID],
ProjectOwner.ProjectName as [Project Name],
ProjectOwner.[Project Number] as [ECP#],
TaskRelated.TaskName as [Task Name],
MSP_WssRiskToTaskLinks_UserView.RiskID as [Risk ID],
MSP_WssRiskToTaskLinks_UserView.Title as [Risk Title],
MSP_WssRiskToTaskLinks_UserView.Status as [Status],
MSP_WssRiskToTaskLinks_UserView.AssignedToResource as [Assigned To],
MSP_WssRiskToTaskLinks_UserView.Owner as [PM],
MSP_WssRiskToTaskLinks_UserView.DueDate as [Due Date],
MSP_WssRiskToTaskLinks_UserView.Probability as [Probability],
MSP_WssRiskToTaskLinks_UserView.Impact as [Impact],
MSP_WssRiskToTaskLinks_UserView.Exposure as [Exposure],
MSP_WssRiskToTaskLinks_UserView.Cost as [Cost],
MSP_WssRiskToTaskLinks_UserView.CostExposure as [Cost Exposure],
MSP_WssRiskToTaskLinks_UserView.Category as [Category],
ISNULL(LTRIM((CONVERT(xml,(@Headxml+MSP_WssRiskToTaskLinks_UserView.[Description]+@Footxml),3)
.value(N'(/)','nvarchar(4000)'))),'') AS [YourMulti-lineCustomFieldNewName],
MSP_WssRiskToTaskLinks_UserView.MitigationPlan as [Mitigation Plan],
MSP_WssRiskToTaskLinks_UserView.ContingencyPlan as [Contingency Plan],
MSP_WssRiskToTaskLinks_UserView.TriggerTask as [Trigger Task],
MSP_WssRiskToTaskLinks_UserView.TriggerDescription as [Trigger Description],
MSP_WssRiskToTaskLinks_UserView.CreatedDate as [Created Date],
MSP_WssRiskToTaskLinks_UserView.CreateByResource as [Create By],
MSP_WssRiskToTaskLinks_UserView.ModifiedByResource as [Modified By],
MSP_WssRiskToTaskLinks_UserView.ModifiedDate as [Modified],
TaskRelated.TaskUID as [TaskUID],
TaskRelated.TaskName as [Task Name],
TaskRelated.TaskStartDate as [Task Start],
TaskRelated.TaskFinishDate as [Task Finish] FROM dbo.MSP_WssRiskToTaskLinks_UserView
LEFT OUTER JOIN dbo.MSP_EpmProject_UserView AS ProjectOwner ON ProjectOwner.ProjectUID = MSP_WssRiskToTaskLinks_UserView.ProjectUID
LEFT OUTER JOIN dbo.MSP_EpmProject_UserView AS ProjectRelated ON ProjectRelated.ProjectUID = MSP_WssRiskToTaskLinks_UserView.RelatedProjectUID
LEFT OUTER JOIN dbo.MSP_EpmTask_UserView AS TaskRelated ON TaskRelated.ProjectUID = MSP_WssRiskToTaskLinks_UserView.RelatedProjectUID
AND TaskRelated.TaskUID = MSP_WssRiskToTaskLinks_UserView.RelatedTaskUID LEFT JOIN dbo.MSP_WssRelationshipType ON
MSP_WssRiskToTaskLinks_UserView.RelationshipTypeID = MSP_WssRelationshipType.RelationshipTypeID
ORDER BY ProjectOwner.ProjectName ASC, MSP_WssRiskToTaskLinks_UserView.RiskID
Andrew PayzeHi Andrew,
We normally create a function to do this. Some examples can be found here:
http://blog.sqlauthority.com/2007/06/16/sql-server-udf-user-defined-function-to-strip-html-parse-html-no-regular-expression/
http://lazycoders.blogspot.co.uk/2007/06/stripping-html-from-text-in-sql-server.html
http://stackoverflow.com/questions/457701/best-way-to-strip-html-tags-from-a-string-in-sql-server
Paul
Paul Mather | Twitter |
http://pwmather.wordpress.com | CPS -
Parsing of xml file in oracle stored procedure on linux server
We have an XML file in the "/database/stats/dev/xml1/" path and tried to parse the file using the below code :
p := xmlparser.newParser;
xmlparser.setValidationMode(p, FALSE);
-- xmlparser.setErrorLog(p, errfile);
xmlparser.setBaseDir(p, dir);
xmlparser.parse(p, inpfile);
doc := xmlparser.getDocument(p);
xmlparser.freeParser(p);
The above procedure is throwing below mentioned exception at "xmlparser.parse(p, inpfile);".
SQLCODE: ORA-31001
SQLERRM: ORA-31001: Invalid resource handle or path name "/xml1.dtd"
The xml file contains the following line, which is giving an error, while parsing the xml file.
<!DOCTYPE CCIOrder SYSTEM "xml1.dtd">
Directory Structure:
OWNER DIRECTORY_NAME DIRECTORY_PATH
SYS XML1 /database/stats/dev/xml1you'll need to use server-side code to check the xml file names in that folder, return that list to flash and display the list to the user.
or, if you can get by presenting a hard-coded list of xml files, you won't need any server-side coding. -
ISM-SRE-300 seems to be a loop at boot with Verifying ... Invalid signature in command line file
Any ideas?
Log
Install of ftp://*****:*****@10.100.64.21/cue-vm-k9.SPA.sme.8.6.7.pkg in progress
Install status : Waiting for RBIP registration
No localstore
2911#
[Resuming connection 1 to 10.102.66.254 ... ]
Initializing memory. Please wait...
Memory initialization OK. Continue...
Authenticating boot loader....
Secondary Boot Loader authenticated - booting....
Please enter '***' to change boot configuration:
Detect and Initialze network device
Backup current platform configurations....
SRE step 1 - SM registration...
SRE step 2 - SM requests key file info...
SRE step 3 - SM stores registration info...
SRE configuration keeps the same. No flash update needed!
SRE step 4 - SM downloads key-file...
Writing keyfile to flash Size 891
writing complete.
Updating flash with bootloader configuration.
Please wait .................. done.
SRE step 5 - SM requests installer info...
SRE step 6 - SM stores installer info...
Updating flash with bootloader configuration.
Please wait .................. done.
SRE step 7 - SM now downloads installer
done.
SRE step 8 - SM requests tcl header file info...
SRE step 9 - SM now downloads the tcl header file
TCL header file downloaded completely size: 691
SRE step 10 - SM requests tcl file info...
SRE step 11 - SM now downloads the tcl file
TCL file downloaded completely size: 38933
SRE step 12 - SM now boots Installer
Verifying ... done.
Starting Kernel.
Platform: ism
INIT: version 2.86 booting
mounting proc fs ...
mounting sys fs ...
mounting /dev/shm tmpfs ...
kernel.sem = 1900 4000 32 100
vm.overcommit_memory = 1
vm.min_free_kbytes = 8192
Welcome to Cisco Service Engine
Setting the system time from hardware clock
********** rc.aesop ****************
Populating resource values from /etc/ism_rsrc_file
Populating resource values from /etc/default_rsrc_file
Populating resource values from /etc/products/cue/default_rsrc_file
Populating resource values from /etc/products/cue/ism_rsrc_file
==> Management interface is eth0
==> Management interface is eth0
IOS IP Address Registration complete.
Kernel IP routing table
Destination Gateway Genmask Flags MSS Window irtt Iface
10.102.66.0 * 255.255.255.0 U 0 0 0 eth0
default 142.102.66.254 0.0.0.0 UG 0 0 0 eth0
Size of buff is: 65536
65536 bytes written
Valid License file not found: Using default values
INIT: Entering runlevel: 2
********** rc.post_install ****************
Changing owners and file permissions.
INIT: Switching to runlevel: 4
INIT: Sending processes the TERM signal
STARTED: dwnldr_startup.sh
sre_type= 1
Welcome to Cisco Systems Service Engine Helper Software
Downloading ftp cue-vm-k9.SPA.sme.8.6.7.pkg
Bytes downloaded : 727736
Validating package signature ... done
- Parsing package manifest files... complete.
No installed manifests found.
- Checking Package dependencies... complete.
Downloading ftp cue-vm-langpack.sme.8.6.7.pkg
Error: Download error
Can not download cue-vm-langpack.sme.8.6.7.pkg
error code 550 : error type 'Can not ▒
Initializing memory. Please wait...
Memory initialization OK. Continue...
DDR Memory 0512 MB detected
Genuine Intel(R) processor 1.06GHz
BIOS ISM 2.6, BIOS Build date: 10/16/2009
System now booting...
Authenticating boot loader....
Secondary Boot Loader authenticated - booting....
Please enter '***' to change boot configuration:
Detect and Initialze network device
Backup current platform configurations....
SRE step 1 - SM registration...
Response - no installation needed (len: 422)
SRE Installation Not Needed
Restoring orignial configuration...
Updating flash with bootloader configuration.
Please wait .................. done.
Loading disk:/bzImage ... Loading disk:/cmdlineextra ... done.
Verifying ... Invalid signature in command line file !!
Corrupted command line detected
done.
Starting Kernel.
Initializing memory. Please wait...
Memory initialization OK. Continue...
DDR Memory 0512 MB detected
Genuine Intel(R) processor 1.06GHz
BIOS ISM 2.6, BIOS Build date: 10/16/2009
System now booting...
Authenticating boot loader....
Secondary Boot Loader authenticated - booting....
Please enter '***' to change boot configuration:
Detect and Initialze network device
Backup current platform configurations....
SRE step 1 - SM registration...
Response - no installation needed (len: 422)
SRE Installation Not Needed
Restoring orignial configuration...
Updating flash with bootloader configuration.
Please wait .................. done.
Loading disk:/bzImage ... Loading disk:/cmdlineextra ... done.
Verifying ... Invalid signature in command line file !!
Corrupted command line detected
done.
Starting Kernel.
Initializing memory. Please wait...
Memory initialization OK. Continue...
DDR Memory 0512 MB detected
Genuine Intel(R) processor 1.06GHz
BIOS ISM 2.6, BIOS Build date: 10/16/2009
System now booting...
Authenticating boot loader....
Secondary Boot Loader authenticated - booting....
Please enter '***' to change boot configuration:
Detect and Initialze network device
Backup current platform configurations....
SRE step 1 - SM registration...
Response - no installation needed (len: 422)
SRE Installation Not Needed
Restoring orignial configuration...
Updating flash with bootloader configuration.
Please wait .................. done.
Loading disk:/bzImage ... Loading disk:/cmdlineextra ... done.
Verifying ... Invalid signature in command line file !!
Corrupted command line detected
done.
Starting Kernel.
Initializing memory. Please wait...
Memory initialization OK. Continue...
DDR Memory 0512 MB detected
Genuine Intel(R) processor 1.06GHz
BIOS ISM 2.6, BIOS Build date: 10/16/2009
System now booting...
Authenticating boot loader....
Secondary Boot Loader authenticated - booting....
Please enter '***' to change boot configuration:
Detect and Initialze network device
Backup current platform configurations....
SRE step 1 - SM registration...
Response - no installation needed (len: 422)
SRE Installation Not Needed
Restoring orignial configuration...
Updating flash with bootloader configuration.
Please wait .................. done.
Loading disk:/bzImage ... Loading disk:/cmdlineextra ... done.
Verifying ... Invalid signature in command line file !!
Corrupted command line detected
done.
Starting Kernel.
Initializing memory. Please wait...
Memory initialization OK. Continue...
DDR Memory 0512 MB detected
Genuine Intel(R) processor 1.06GHz
BIOS ISM 2.6, BIOS Build date: 10/16/2009
System now booting...
Authenticating boot loader....
Secondary Boot Loader authenticated - booting....
Please enter '***' to change boot configuration:
Detect and Initialze network device
Backup current platform configurations....
SRE step 1 - SM registration...
Response - no installation needed (len: 422)
SRE Installation Not Needed
Restoring orignial configuration...
Updating flash with bootloader configuration.
Please wait .................. done.
Loading disk:/bzImage ... Loading disk:/cmdlineextra ... done.
Verifying ... Invalid signature in command line file !!
Corrupted command line detected
done.
Starting Kernel.
Initializing memory. Please wait...
Memory initialization OK. Continue...
DDR Memory 0512 MB detected
Genuine Intel(R) processor 1.06GHz
BIOS ISM 2.6, BIOS Build date: 10/16/2009
System now booting...
Authenticating boot loader....
Secondary Boot Loader authenticated - booting....
Please enter '***' to change boot configuration:
Detect and Initialze network device
Backup current platform configurations....
SRE step 1 - SM registration...
Response - no installation needed (len: 422)
SRE Installation Not Needed
Restoring orignial configuration...
Updating flash with bootloader configuration.
Please wait .................. done.
Loading disk:/bzImage ... Loading disk:/cmdlineextra ... done.
Verifying ... Invalid signature in command line file !!
Corrupted command line detected
done.
Starting Kernel.
Initializing memory. Please wait...
Memory initialization OK. Continue...
DDR Memory 0512 MB detected
Genuine Intel(R) processor 1.06GHz
BIOS ISM 2.6, BIOS Build date: 10/16/2009
System now booting...ISM-SRE-300 seems to be a loop at boot with Verifying ... Invalid signature in command line file
Any ideas?
Log
Install of ftp://*****:*****@10.100.64.21/cue-vm-k9.SPA.sme.8.6.7.pkg in progress
Install status : Waiting for RBIP registration
No localstore
2911#
[Resuming connection 1 to 10.102.66.254 ... ]
Initializing memory. Please wait...
Memory initialization OK. Continue...
Authenticating boot loader....
Secondary Boot Loader authenticated - booting....
Please enter '***' to change boot configuration:
Detect and Initialze network device
Backup current platform configurations....
SRE step 1 - SM registration...
SRE step 2 - SM requests key file info...
SRE step 3 - SM stores registration info...
SRE configuration keeps the same. No flash update needed!
SRE step 4 - SM downloads key-file...
Writing keyfile to flash Size 891
writing complete.
Updating flash with bootloader configuration.
Please wait .................. done.
SRE step 5 - SM requests installer info...
SRE step 6 - SM stores installer info...
Updating flash with bootloader configuration.
Please wait .................. done.
SRE step 7 - SM now downloads installer
done.
SRE step 8 - SM requests tcl header file info...
SRE step 9 - SM now downloads the tcl header file
TCL header file downloaded completely size: 691
SRE step 10 - SM requests tcl file info...
SRE step 11 - SM now downloads the tcl file
TCL file downloaded completely size: 38933
SRE step 12 - SM now boots Installer
Verifying ... done.
Starting Kernel.
Platform: ism
INIT: version 2.86 booting
mounting proc fs ...
mounting sys fs ...
mounting /dev/shm tmpfs ...
kernel.sem = 1900 4000 32 100
vm.overcommit_memory = 1
vm.min_free_kbytes = 8192
Welcome to Cisco Service Engine
Setting the system time from hardware clock
********** rc.aesop ****************
Populating resource values from /etc/ism_rsrc_file
Populating resource values from /etc/default_rsrc_file
Populating resource values from /etc/products/cue/default_rsrc_file
Populating resource values from /etc/products/cue/ism_rsrc_file
==> Management interface is eth0
==> Management interface is eth0
IOS IP Address Registration complete.
Kernel IP routing table
Destination Gateway Genmask Flags MSS Window irtt Iface
10.102.66.0 * 255.255.255.0 U 0 0 0 eth0
default 142.102.66.254 0.0.0.0 UG 0 0 0 eth0
Size of buff is: 65536
65536 bytes written
Valid License file not found: Using default values
INIT: Entering runlevel: 2
********** rc.post_install ****************
Changing owners and file permissions.
INIT: Switching to runlevel: 4
INIT: Sending processes the TERM signal
STARTED: dwnldr_startup.sh
sre_type= 1
Welcome to Cisco Systems Service Engine Helper Software
Downloading ftp cue-vm-k9.SPA.sme.8.6.7.pkg
Bytes downloaded : 727736
Validating package signature ... done
- Parsing package manifest files... complete.
No installed manifests found.
- Checking Package dependencies... complete.
Downloading ftp cue-vm-langpack.sme.8.6.7.pkg
Error: Download error
Can not download cue-vm-langpack.sme.8.6.7.pkg
error code 550 : error type 'Can not ▒
Initializing memory. Please wait...
Memory initialization OK. Continue...
DDR Memory 0512 MB detected
Genuine Intel(R) processor 1.06GHz
BIOS ISM 2.6, BIOS Build date: 10/16/2009
System now booting...
Authenticating boot loader....
Secondary Boot Loader authenticated - booting....
Please enter '***' to change boot configuration:
Detect and Initialze network device
Backup current platform configurations....
SRE step 1 - SM registration...
Response - no installation needed (len: 422)
SRE Installation Not Needed
Restoring orignial configuration...
Updating flash with bootloader configuration.
Please wait .................. done.
Loading disk:/bzImage ... Loading disk:/cmdlineextra ... done.
Verifying ... Invalid signature in command line file !!
Corrupted command line detected
done.
Starting Kernel.
Initializing memory. Please wait...
Memory initialization OK. Continue...
DDR Memory 0512 MB detected
Genuine Intel(R) processor 1.06GHz
BIOS ISM 2.6, BIOS Build date: 10/16/2009
System now booting...
Authenticating boot loader....
Secondary Boot Loader authenticated - booting....
Please enter '***' to change boot configuration:
Detect and Initialze network device
Backup current platform configurations....
SRE step 1 - SM registration...
Response - no installation needed (len: 422)
SRE Installation Not Needed
Restoring orignial configuration...
Updating flash with bootloader configuration.
Please wait .................. done.
Loading disk:/bzImage ... Loading disk:/cmdlineextra ... done.
Verifying ... Invalid signature in command line file !!
Corrupted command line detected
done.
Starting Kernel.
Initializing memory. Please wait...
Memory initialization OK. Continue...
DDR Memory 0512 MB detected
Genuine Intel(R) processor 1.06GHz
BIOS ISM 2.6, BIOS Build date: 10/16/2009
System now booting...
Authenticating boot loader....
Secondary Boot Loader authenticated - booting....
Please enter '***' to change boot configuration:
Detect and Initialze network device
Backup current platform configurations....
SRE step 1 - SM registration...
Response - no installation needed (len: 422)
SRE Installation Not Needed
Restoring orignial configuration...
Updating flash with bootloader configuration.
Please wait .................. done.
Loading disk:/bzImage ... Loading disk:/cmdlineextra ... done.
Verifying ... Invalid signature in command line file !!
Corrupted command line detected
done.
Starting Kernel.
Initializing memory. Please wait...
Memory initialization OK. Continue...
DDR Memory 0512 MB detected
Genuine Intel(R) processor 1.06GHz
BIOS ISM 2.6, BIOS Build date: 10/16/2009
System now booting...
Authenticating boot loader....
Secondary Boot Loader authenticated - booting....
Please enter '***' to change boot configuration:
Detect and Initialze network device
Backup current platform configurations....
SRE step 1 - SM registration...
Response - no installation needed (len: 422)
SRE Installation Not Needed
Restoring orignial configuration...
Updating flash with bootloader configuration.
Please wait .................. done.
Loading disk:/bzImage ... Loading disk:/cmdlineextra ... done.
Verifying ... Invalid signature in command line file !!
Corrupted command line detected
done.
Starting Kernel.
Initializing memory. Please wait...
Memory initialization OK. Continue...
DDR Memory 0512 MB detected
Genuine Intel(R) processor 1.06GHz
BIOS ISM 2.6, BIOS Build date: 10/16/2009
System now booting...
Authenticating boot loader....
Secondary Boot Loader authenticated - booting....
Please enter '***' to change boot configuration:
Detect and Initialze network device
Backup current platform configurations....
SRE step 1 - SM registration...
Response - no installation needed (len: 422)
SRE Installation Not Needed
Restoring orignial configuration...
Updating flash with bootloader configuration.
Please wait .................. done.
Loading disk:/bzImage ... Loading disk:/cmdlineextra ... done.
Verifying ... Invalid signature in command line file !!
Corrupted command line detected
done.
Starting Kernel.
Initializing memory. Please wait...
Memory initialization OK. Continue...
DDR Memory 0512 MB detected
Genuine Intel(R) processor 1.06GHz
BIOS ISM 2.6, BIOS Build date: 10/16/2009
System now booting...
Authenticating boot loader....
Secondary Boot Loader authenticated - booting....
Please enter '***' to change boot configuration:
Detect and Initialze network device
Backup current platform configurations....
SRE step 1 - SM registration...
Response - no installation needed (len: 422)
SRE Installation Not Needed
Restoring orignial configuration...
Updating flash with bootloader configuration.
Please wait .................. done.
Loading disk:/bzImage ... Loading disk:/cmdlineextra ... done.
Verifying ... Invalid signature in command line file !!
Corrupted command line detected
done.
Starting Kernel.
Initializing memory. Please wait...
Memory initialization OK. Continue...
DDR Memory 0512 MB detected
Genuine Intel(R) processor 1.06GHz
BIOS ISM 2.6, BIOS Build date: 10/16/2009
System now booting... -
How to determine the length of a line of text in a multi line text control
I am working on a simple widget to compare two snippets of text. The string controls are side by side with a colum of square bools in between
the two string controls.
The Bools line up with the lines of text in each string control. The Bools are used as a quick indicator that at that line point there is a difference
between the two string controls.
There is a slider that allows the user to scroll up and down, the slider scrolls both string controls simutaneously.
As the string controls are scrolled I will be comparing the left and right lines of text and reflecting the match status in the Bool Colum.
The reason I need to know the length of the line of text is so each line can be compared against one another. It is not as simple as counting the
col width of the string control and parsing the text because if there is a line return the text will word wrap before before it extends all the way accross the string control, which will cause parsing discrepencies.
Any suggestions on obtaining the multi line string control text character length would be much appreciated.
Best Regards
Tim C.
1:30 Seconds ARRRGHHH!!!! I want my popcorn NOW! Isn't there anything faster than a microwave!Front panel of widget....
1:30 Seconds ARRRGHHH!!!! I want my popcorn NOW! Isn't there anything faster than a microwave!
Attachments:
One.vi 27 KB -
How to create a dynamic multi-line function in SQL Server
I am attempting to create a Multi-Line Function in SQL Server that accepts a dynamic WHERE clause as a parameter. I need this so that the function can be as versatile as possible for the filter that needs to be applied. I am unfortunately getting an error
upon creation of the function. I don't know how to solve the problem. Can someone advise me?
SQL:
SET
ANSI_NULLSON
GO
SET
QUOTED_IDENTIFIERON
GO
-- =============================================
-- Author:
-- Create date: 2/3/2014
-- Description: This multiline function will accept a generic WHERE Clause and apply it to the query for return.
-- =============================================
CREATE
FUNCTIONTESTMULTILINEFUNCTION
@WHEREvarchar(1024)
,@CHANGEDDATEasdatetime
RETURNS
@TESTTABLE
TABLE
IDint
,REVint
AS
BEGIN
Declare@SQLSTRINGvarchar(4096)
SET@SQLSTRING=''
SET@SQLSTRING=@SQLSTRING+'SELECT
REVS.ID, REVS.Revision
FROM
Select distinct result.ID, Max(Rev) as ''''Revision''''
FROM
Select * from dbo.BugsAll
where
[Changed Date] < @CHANGEDDATE
) result
GROUP BY result.ID
) REVS
join dbo.BugsAll BA on (BA.ID=REVS.ID AND BA.REV=REVS.revision)'
IF
(@WHEREisnotnullOR@WHERE<>'')
BEGIN
SET@SQLSTRING=@SQLSTRING+'
WHERE '+@WHERE;
END
INSERT@TESTTABLE
EXEC
(@SQLSTRING)
RETURN
END
GO
ERROR:
Msg 443, Level 16, State 14, Procedure TESTMULTILINEFUNCTION, Line 44
Invalid use of a side-effecting operator 'INSERT EXEC' within a function.
Senior Test Lead -- Microsoft>> Unfortunately I really need to form a dynamic query in a table valued function on the SQL SERVER. I have another tabled valued function that needs something returned as a table in order to further join the data. I am not allowed to use Stored
Procedures in that function. <<
You do know that real SQL programmers hate the proprietary nightmare of tabled valued functions? This is how you procedural programmers avoid learning set-oriented declarative and functional programming.
Your mindset wants to write to a scratch tape or disk file (aka “tabled valued function result table”) just like you did BASIC, FORTRAN or COBOL. QL programmers do not have to materialize their data. We can use VIEW or a drive table as well as a base table.
>> Plus, there are occasions where I don't want to pass in a field [sic: columns are not fields] parameter or need to change a parameter list such that I don't wish the table function to filter by a particular field [sic] or other setting. <<
What you want is a magical “Automobiles, Squids and Lady Gaga” function. An SQL programmer might write a complex VIEW then do simpler SELECTs off it.
>> My application pushes the WHERE clause from EXCEL to SQL to do the hard work as EXCEL is not the application in which I want to process the SQL statement and pass it via ODBC. I cannot run macros in Excel on the web.<<
This is a crazy language system. Usually we fetch data in SQL and then pass it to a math package, report writer, etc. We never keep logic (aka WHERE clauses) outside the database.
>> I am bummed about the fact that this feature doesn't work. It will up my server management costs to maintain unique tabular based functions based on WHERE clause query <<
So stop writing those “tabular based functions”, change your mindset and start learning SQL and do it right.
--CELKO-- Books in Celko Series for Morgan-Kaufmann Publishing: Analytics and OLAP in SQL / Data and Databases: Concepts in Practice Data / Measurements and Standards in SQL SQL for Smarties / SQL Programming Style / SQL Puzzles and Answers / Thinking
in Sets / Trees and Hierarchies in SQL -
New lines created in excel when displaying multi-line text item value
Hi all,
I put the value of a multi-line text-item into a csv file :
DECLARE
file_filter VARCHAR2(256) := 'Export Files (*.csv)/*.csv/All Files (*.*)/*.*/';
fExp VARCHAR2(256);
in_file Text_IO.File_Type;
linebuf VARCHAR2(4000);
BEGIN
fExp := get_file_name ( directory_name, file_name, file_filter, NULL, SAVE_FILE, TRUE);
IF fExp IS NOT NULL
THEN
set_application_property(cursor_style,'BUSY');
in_file := Text_IO.Fopen( fExp, 'W');
linebuf := NVL(:com_bnc_possibles.LIBEL_TRAITE,'') || ';' ||
NVL(:com_bnc_possibles.NUM_ANFR_ID,'') || ';' ||
NVL(:com_bnc_possibles.ver_fiche,'') || ';' ||
NVL(:com_bnc_possibles.titre,'') || ';' ||
NVL(to_char(:com_bnc_possibles.date_creat, 'dd/mm/yyyy'),'') || ';' ||
NVL(to_char(:com_bnc_possibles.date_valide, 'dd/mm/yyyy'),'') || ';' ||
NVL(:com_bnc_possibles.LIBEL_STATUT,'') || ';' ||
NVL(:com_bnc_possibles.label_reg,'') || ';' ||
NVL(:com_bnc_possibles.nom,'') || ';' ||
NVL(:com_bnc_possibles.prenom,'') || ';' ||
NVL(:com_bnc_possibles.nom_societe,'') || ';' ||
NVL(:com_bnc_possibles.comp_bnc,'') || ';' ||
NVL(:com_bnc_possibles.motifs,'') || ';' ;
Text_IO.Put_Line( in_file, linebuf);
Text_IO.Fclose( in_file);
set_application_property(cursor_style,'DEFAULT');
END IF;
END;
And when I opened the csv file then the remaining lines , that is from the second line , of the column "motifs" are displayed through the column A of excel. The "motifs" multi-line text-item has 500 as its Maximum Length property value, and has a Char Data Type property value.
So how to display all the motifs' lines through the same column M without displaying the remaining lines in column A ?
Or are there tips to remove CHR(13) characters from a multi-line text-item ?
Thank you very much indeed.
Message was edited by:
andrianiainaHi,
I tried to do it in different way. What i did is I have created a item of type formattted text and set its text like:--
<html>User authentication failed. <br*> Cause: Invalid password.</html> --remove *
So I am able to see the prompt like :-
User authentication failed.
Cause: Invalid password.
Hope this helps you...
Thanks
--Anil -
[SOLVED] Parsing simple config files in pure bash
Hi everyone,
I'd like to implement a bash function to parse a simple config file for a script I've wrote. The conifg file contains different sections for different scenarios. Here's an example how it should look like:
# configuration file
# global settings
global {
DATE_PREFIX="-I"
SSHFS_OPTS="-C"
EXT_FULL="full"
EXT_DIFF="diff"
EXT_CATALOGUE="catalogue"
DAR_OPTS="-v -m 256 -y -s 600M -D"
DAR_NOCOMPR="-Z '*.gz' -Z '*.bz2' -Z '*.zip' -Z '*.png'"
# system settings
system {
DAR_OPTS="-v -m 256 -y -s 200M -D"
It contains some settings which are global for the whole script and special settings groups which can be used to overwrite global settings.
The function to parse this config file looks as follows:
#!/bin/sh
CONFIG="/home/chi/.daruprc"
function readconf() {
match=0
while read line; do
# skip comments
[[ ${line:0:1} == "#" ]] && continue
# still no match? lets check again
if [ $match == 0 ]; then
# do we have an open tag ?
if [[ ${line:$((${#line}-1))} == "{" ]]; then
# strip "{"
group=${line:0:$((${#line}-1))}
# do we have a match ?
if [[ ${group} -eq $1 ]]; then
match=1
continue
fi
continue
fi
# found close tag but still no match - continue
elif [[ ${line:0} == "}" && $match == 0 ]]; then
continue
# found close tag after config was read - exit loop
elif [[ ${line:0} == "}" && $match == 1 ]]; then
break
# got a config line return it
else
echo $line
fi
done < "$CONFIG"
for line in $(readconf "system"); do
echo $line
done
As you can see I try to just echo the lines at the moment. And here's the problem: It seems I have some " escape issues, if I run it I get the following output:
./parseconfig.sh
DATE_PREFIX="-I"
SSHFS_OPTS="-C"
EXT_FULL="full"
EXT_DIFF="diff"
EXT_CATALOGUE="catalogue"
DAR_OPTS="-v
-m
256
-y
-s
600M
-D"
DAR_NOCOMPR="-Z
'*.gz'
-Z
'*.bz2'
-Z
'*.zip'
-Z
'*.png'"
As you can see there are way to much newlines - which leads to problems when I try to use "eval" to initialize the variables.
I am sure I am missing something simple here, however I am looking for a solution for a few days now - maybe one of the bash gurus on this board can enlighten me ;-).
Thanks in advance
PS.: I am trying to do this in pure bash because the script also needs to run on embedded machines with very low memory like my router on which I don't have sed or awk or the like. I also know that I could for example just use different config files to circumvent the whole parsing - but I am just curious if this could work the way I like ;-).
Last edited by chimeric (2007-11-04 23:20:58)chimeric wrote:
Hi MrWeatherbee,
well yes, but I want to assign (eval) these lines to get variables out of them. Since the while loop is trapped in its' own subshell I need to return the lines into the parent one to be able to make these variables "visible" in the script itself.
Right. But I was trying to show you that the way you were going about it wouldn't work at a very fundamental level.
Without changing too much code just for a quick and dirty demo,
change:
# got a config line return it
else
echo $line
fi
done < "$CONFIG"
# got a config line return it
else
line_array=( "${line_array[@]}" "$line" )
fi
done < "$CONFIG"
numarrayelements=${#line_array[@]}
and then in the main program code, do this:
readconf "system"
for index in $( seq $numarrayelements ); do
line=${line_array[(($index-1))]}
echo $line
done
Using an array to collect the good lines from the function allows you to reuse them later for whatever purpose. Although other ways exist, you certainly don't want to do what you originally did.
Edit:
I posted the code with an incorrectly referenced variable and had to fix it.
Last edited by MrWeatherbee (2007-11-04 22:46:34)
Maybe you are looking for
-
500 Internal Server Error for Team under MSS SAP portal !!!
Dear Experts, I'm trying to access Team under MSS from Portal, It throughs 500 Internal server Error as shown below. we are running EP 7.3. 500 Internal Server Error The initial exception that caused the request to fail, was: Java.lang.IllegalArgum
-
How do I stop itunes emails?
How do I get Itunes to stop sending me emails that I do not want? If I want something from Itunes I will go there I don't like ADS.
-
Hi Guru's, I have a flat file with Sales person, City, product, quantity, amount and calyear. I created info objects for sales person, product, quantity and amount. I gave city as attribute for sales person. while creating infocube i can't see the ci
-
Material lying with subcontractor
All SAP Gurus, We are using subcontracting PO and with reference to those PO sending the material to subcontractor. Then we make the GR against the subcontracting PO. Some stock always lye with the subcontractor. How to know the document numbers (tra
-
when i close the lid its only shows black screen nothing else how to fix that is there some way to fix i trie it to put analog clock and other things but its shows only black screen and my next question is there any way when phone rings to say caller