Need to place a pipe | delimiter in extract
I am using Crystal 11, and need to know if there is a way to place a pipe | delimiter between each field. I am pulling data from one application to another, and the receiving analyst has requested a pipe between each field. I know I can export the report to .csv however, he has requested a pipe.
Please advise
Thanks
Jack
You can try exporting to .csv by using pipe symbol as delimeter in the export options.
Regards,
Raghavendra
Similar Messages
-
Help needed in extracting pipe delimited fields in a CLOB data type
hi
i Had a table with clob field as shown below.
CREATE TABLE TRANSACTION_INFO
TRASACTION_ID CLOB,
LOG_ID NUMBER
Insert into TRANSACTION_INFO
(TRASACTION_ID, LOG_ID)
Values
('354502002020910|000000610214609663||09/27/09 08:02:37|RNEW|DC25|MOTOROLA|8802939198', 123);
Insert into TRANSACTION_INFO
(TRASACTION_ID, LOG_ID)
Values
('354599892020910|000000610214609663||09/27/10 08:12:47|SOLD|DC23||8802939198', 456);
COMMIT;As you can see Clob field is a pipe delimited data.Now i am able to extract the first two fields using the below querry.But it may be the right solution as
substring function fails if there is missing character in any on the fields.
Also when there is a null value in any of the fields,how can i be able to get as null value ? Basically i want to get the values in a delimited manner.
how can we do this ?
Select Substr (TRASACTION_ID, 1, Instr (TRASACTION_ID, '|')-1) field1,
Substr (TRASACTION_ID, 17, Instr (TRASACTION_ID, '|')+2) field2
From TRANSACTION_INFO;
output should be like as shown
FIELD1 FIELD2 FEILD3 FEILD4
354502002020910 000000610214609663 09/27/09 08:02:37
354599892020910 000000610214609663 09/27/10 08:12:47Thanks
Redehi Michael
Thanks for the solution and its my bad not mention that there is a possibility of having a null value at the start of the record also which RPLACE function no longer works for this case.
For example
with transaction_info (trasaction_id, log_id)
as (
select '354502002020910|000000610214609663||09/27/09 08:02:37|RNEW|DC25|MOTOROLA|8802939198', 123 from dual union all
select '354599892020910|000000610214609663||09/27/10 08:12:47|SOLD|DC23||8802939198', 456 from dual union all
select '|000000610214609663||09/27/10 08:12:47|SOLD|DC23||8802939198', 456 from dual
select trim(regexp_substr (trasaction_id, '[^|]+', 1, 1)) f1,
trim(regexp_substr (trasaction_id, '[^|]+', 1, 2)) f2,
trim(regexp_substr (trasaction_id, '[^|]+', 1, 3)) f3,
trim(regexp_substr (trasaction_id, '[^|]+', 1, 4)) f4,
trim(regexp_substr (trasaction_id, '[^|]+', 1, 5)) f5
from (select replace (trasaction_id, '||', '| |') trasaction_id from transaction_info)
F1 F2 F3 F4 F5
354502002020910 000000610214609663 09/27/09 08:02:37 RNEW
354599892020910 000000610214609663 09/27/10 08:12:47 SOLD
000000610214609663 09/27/10 08:12:47 SOLD Now the last record is wrongly created.... -
Extract data from Pipe Delimited file
Hi everybody,
Could someone provide me the command to extract data from a pipe delimited file ("|") using Open/Read Data set.
I mean eliminating the delimiter ("|") and just picking the data.
Thanks
MHere you go.. this code snippet parses the input file record by using pipe (variable lv_pipe) as separator, for tab separated file you can use lv_tab like wise...
TYPES: BEGIN OF ts_field,
field(50) TYPE c,
END OF ts_field,
tt_field TYPE TABLE OF ts_field.
DATA: ls_record TYPE string,
ls_input_data TYPE ts_input_data,
lv_tab TYPE x VALUE '09',
lv_pipe TYPE C VALUE '|',
ls_field TYPE ts_field,
lt_field_tab TYPE tt_field,
lv_field_index TYPE syindex,
lv_record_no TYPE syindex.
FIELD-SYMBOLS: <fs_field> TYPE ANY.
OPEN DATASET fv_file_path IN TEXT MODE FOR INPUT.
IF sy-subrc = 0.
DO.
lv_record_no = lv_record_no + 1.
READ DATASET fv_file_path INTO ls_record.
IF sy-subrc NE 0.
EXIT.
ELSE.
SPLIT ls_record AT lv_pipe INTO TABLE lt_field_tab.
CLEAR: lv_field_index, ls_input_data.
LOOP AT lt_field_tab INTO ls_field.
lv_field_index = lv_field_index + 1.
ASSIGN COMPONENT lv_field_index OF STRUCTURE
ls_input_data TO <fs_field>.
IF sy-subrc = 0.
<fs_field> = ls_field-field.
ENDIF.
ENDLOOP.
APPEND ls_input_data TO ft_input_data.
ENDIF.
ENDDO.
CLOSE DATASET fv_file_path. -
XML Column from table extract to Pipe Delimited Text File
Hi,
I have an XML column with large data in a Table ( Source SQL server Database).
I was asked to extract XML column to .txt file using SSIS.
Is it possible to extract xml column with huge data to text file ?
when I tried, select XML column from Table in source , I noticed that Property of column is taken as [DT_NTEXT] . I Converted it to DT_TEXT as Ansi donot support DT_NTEXT.
Execution method was success but it failed due to trucation. so wondering is there a way to get XML column extracted to Pipe delimited text file?
Is it advisable to do this ? or IS It Valid to export XML in Pipe Delimited File ?
Please Kindly advice
thanks
kodiAre you looking at shredding data within XML nodes and then importing it to text file or are you looking at exporting XML value as is? Also is SSIS a necessity?
If not, You can simply use T-SQL for this along with bcp for this. just use a query like
EXEC xp_cmdshell 'bcp "SELECT CAST(XMLColumn AS varchar(max)) AS Column FROM table" queryout <full file path> -c -S <ServerName> -T -t |'
provided you use trusted connection (windows authentication)
see
http://visakhm.blogspot.in/2013/10/bcp-out-custom-format-data-to-flat-file.html
If you want to shred the data use Xpath functions in the query as below
http://visakhm.blogspot.in/2012/10/shred-data-as-well-as-metadata-from-xml.html
Please Mark This As Answer if it helps to solve the issue Visakh ---------------------------- http://visakhm.blogspot.com/ https://www.facebook.com/VmBlogs -
Need to write output to a file in pipe ( | )delimited format
Hi All,
I am trying to extract values from a database and write them to a text file with pipe( | ) delimited format. Can someone guide me on this with an example. I ma very much new to Java.
Thanks for help,
Abhiabhibora wrote:
Hi All,
I am trying to extract values from a database and write them to a text file with pipe( | ) delimited format. Can someone guide me on this with an example. I ma very much new to Java.
Thanks for help,
AbhiSimply print your values separated by the '|' pipe symbol; I don't see the problem.
kind regards,
Jos -
Dynamic Extract. Do Not Want Leading Zeros in Pipe Delimited Record
Greetings,
I am using the following code to create a pipe delimited extract file dynamically. The problem: leading zeros are being lost. For example, when I do an extract of BKPF, BELNR is appended to the extract without leading zeros. This is a problem. Any suggestions for resolving this?
DATA: lv_dref TYPE REF TO data,
lv_dref2 TYPE REF TO data,
lv_data TYPE ty_data,
ls_data TYPE ty_data,
oref TYPE REF TO cx_root,
text TYPE string.
CREATE DATA lv_dref TYPE (p_tab-low).
ASSIGN lv_dref->* TO <lfs>.
CREATE DATA lv_dref2 TYPE TABLE OF (p_tab-low).
ASSIGN lv_dref2->* TO <lft_main>.
CLEAR ds_clauses.
MOVE p_tab-low TO ds_clauses-tablename.
READ TABLE twhere WITH KEY ds_clauses-tablename
INTO ds_clauses.
TRY.
SELECT * FROM (p_tab-low) INTO TABLE <lft_main>
WHERE (ds_clauses-where_tab).
CATCH cx_sy_dynamic_osql_semantics INTO oref.
text = oref->get_text( ).
ENDTRY.
cv_subrc = sy-subrc.
gv_tot_cnt = gv_suc_cnt = sy-dbcnt.
CHECK gv_tot_cnt > 0.
LOOP AT <lft_main> ASSIGNING <lfs>.
CLEAR: ls_data.
DO.
ASSIGN COMPONENT sy-index OF STRUCTURE <lfs> TO <lfv>.
IF sy-subrc IS NOT INITIAL.
EXIT.
ENDIF.
WRITE: <lfv> TO lv_data.
IF ls_data IS NOT INITIAL.
*LEADING ZEROS ARE LOST HERE (at conatenate)
CONCATENATE ls_data lv_data INTO ls_data
SEPARATED BY '|'.
ELSE.
ls_data = lv_data.
ENDIF.
ENDDO.
APPEND ls_data TO ct_data.
ENDLOOP.
Your response is greatly appreciated.
Kind Regards,
JasonYou are losing it because of the write statement, change it to a move. I assume you are using the WRITE to put the correct formatting for a date field or a type P field, if that is the case, you can try to check which field is being written at the time by check sy-index or checking the type at runtime.
*WRITE: <lfv> TO lv_data.
move <lfv> to lv_data.
IF ls_data IS NOT INITIAL.
*LEADING ZEROS ARE LOST HERE (at conatenate)
CONCATENATE ls_data lv_data INTO ls_data
SEPARATED BY '|'.
ELSE.
ls_data = lv_data.
ENDIF.
Regards,
RIch Heilman -
Datas extracted from production tables in Oracle into pipe delimited flat f
Hi
Plz anyone tel me the query how to extract data in oracle into pipe delimited flat files using plsql stored procedure and also do incremental updates.plz tel me its urgenthow to extract data in oracle into pipe delimited flat files using plsql stored procedure You can try utl_file.
and also do incremental updates.This part I don't get. Updates to what? The above file?
plz tel me its urgentWe don't care. -
Need file on Application server to be pipe delimited
Hi,
I want the file in the application server with headings and pipe delimited... I have used
IF NOT T_OUTPUT[] IS INITIAL.
Transfer the changed T_INPUTFILE data to application server.
OPEN DATASET V_FILEPATH FOR OUTPUT IN TEXT MODE ENCODING DEFAULT
MESSAGE V_MSG.
IF SY-SUBRC <> 0.
MESSAGE I008. " File could not be opened.
EXIT.
ENDIF.
Transferring Data
LOOP AT T_OUTPUT.
TRANSFER T_OUTPUT TO V_FILEPATH.
ENDLOOP.
CLOSE DATASET V_FILEPATH.
ENDIF.
But this is not giving me output like below...
RefDoc.No.
Text
Period
Year
9
Dummy Text
002
2006
How do I get a pipe delimited file on the application server ... ??Hi,
Check this..
DATA: V_STRING TYPE STRING.
LOOP AT T_OUTPUT.
DO.
ASSIGN COMPONENT SY-INDEX OF STRUCTURE T_OUTPUT TO <FS>.
IF SY-SUBRC <> 0 .EXIT .ENDIF.
IF SY-INDEX = 1.
V_STRING = <FS>.
ELSE.
CONCATENATE V_STRING '|' <FS> INTO V_STRING.
ENDIF.
ENDDO.
TRANSFER V_STRING TO V_FILEPATH.
ENDLOOP.
Thanks,
Naren -
Need a pipe delimiter after every field in the file on application server
Hi ,
i have to transport data in internal table to a file on application server.
I have done this successfully. But the problem is i have to put a pipe
delimiter after every field in the file on application server.
Could yoe plz help in this issue.
Thanks & Regards
Suresh kumar DHi Should,
I think the below code should solve your problem as i also had a similar type of requirement and this was the code i had used in my program.
FIELD-SYMBOLS: <FS> TYPE ANY.
DATA: L_FLINE TYPE STRING.
Open file for output
M_CHECK_SELSCR_FNMS O1 O.
LOOP AT I_TARGET.
Write records to file
DO.
ASSIGN COMPONENT SY-INDEX OF STRUCTURE I_TARGET TO <FS>.
IF SY-SUBRC EQ 0.
IF SY-INDEX EQ 1.
MOVE <FS> TO L_FLINE.
ELSEIF <FS> NE C_PIPE.
CONCATENATE L_FLINE C_PIPE <FS> INTO L_FLINE.
ELSE.
CONCATENATE L_FLINE <FS> INTO L_FLINE.
ENDIF.
ELSE.
TRANSFER L_FLINE TO W_SRVR_NM_O_O1.
EXIT.
ENDIF.
ENDDO.
ENDLOOP.
Close file
CLOSE DATASET W_SRVR_NM_O_O1.
IF SY-SUBRC EQ 0.
MESSAGE S208(00) WITH TEXT-M02.
ENDIF.
Regards
Sikha -
File content conversion for Pipe delimited file
Hi
i have a scenario ( file-xi-proxy) in whch file is coming in a pipe delimited.
my data type is like
DT_ XXXXX
AwardInfo
Header contains some fileds
DetailRecord contains some fileds
trailer contains some fields
what are content conversion parameters i have to use
venkatSedamkar,
Expecting you have one header, multiple details and one trailer then give recordset structure in sender file communication channel as:
Header,1,DetailRecord ,*,trailer,1
In content conversion you should give parameters:
Header.fieldSeparator : |
Header.endSeparator : 'nl'
DetailRecord.fieldSeparator : |
DetailRecord.endSeparator : 'nl'
trailer.fieldSeparator : |
trailer.endSeparator : 'nl'
You may need to change the parameters also according to your strcuture and the file layout. See this SAP help for file content conversion:
http://help.sap.com/saphelp_nw04/helpdata/en/e3/94007075cae04f930cc4c034e411e1/content.htm
http://help.sap.com/saphelp_nw04/helpdata/en/2c/181077dd7d6b4ea6a8029b20bf7e55/content.htm
Regards,
---Satish -
Hi guys,
I am uploading the data from a file which is in the application server and in pipe delimiter format.
This file in the format like .... let us take 100 records among those one record is header, 98 data records and one trailer record. These are seperated by the record locater like header with 0, data record with 1 and trailer with 9.
So what i am doing is uploading that file first of all into one internal table I_ARFILE, then splitting the data at pipe into 3 different internal tables. In the mean time I am doing the validations also for the number of records...
like there should not be more than one header, and one trailer........
here I am pasting my code.....
IF l_subrc = 0.
LOOP AT I_ARFILE.
READ TABLE I_ARFILE INTO WA_ARFILE.
SPLIT WA_ARFILE AT C_PIPE INTO WA_ARHEADER-P_RECTYPE
WA_ARHEADER-P_PRCID
WA_ARHEADER-P_SENDR
WA_ARHEADER-P_CDATE
WA_ARHEADER-P_CTIME
WA_ARHEADER-P_OBTYP
WA_ARHEADER-P_SEQNO
WA_ARHEADER-P_FRTXT.
IF WA_ARHEADER-P_RECTYPE = 0.
APPEND WA_ARHEADER TO I_ARHEADER.
DESCRIBE TABLE I_ARHEADER LINES V_ITABLINES.
VALIDATION FOR NUMBER OF HEADER RECORDS
IF V_ITABLINES <> 1.
MESSAGE 'NUMBER OF LINES READ ARE NOT SAME' TYPE 'E'.
LEAVE PROGRAM.
ENDIF.
CLEAR V_ITABLINES.
ELSE.
SPLIT I_ARFILE AT C_PIPE
INTO WA_ARITEM-P_RECTYPE
WA_ARITEM-p_xblnr
WA_ARITEM-p_bldat
WA_ARITEM-p_budat
WA_ARITEM-p_blart
WA_ARITEM-p_awkey
WA_ARITEM-p_kunnr
WA_ARITEM-p_xref1
WA_ARITEM-p_xref2
WA_ARITEM-p_xref3
WA_ARITEM-p_wrbtr
WA_ARITEM-p_zterm
WA_ARITEM-p_zuonr
WA_ARITEM-p_rstgr
WA_ARITEM-p_wskto
WA_ARITEM-p_sgtxt.
IF WA_ARITEM-P_RECTYPE = 1.
APPEND WA_ARITEM TO I_ARITEM.
ENDIF.
VALIDAITON FOR THE NUMBER OF DATA RECORDS.
DESCRIBE TABLE I_ARITEM LINES V_ITABLINES.
DESCRIBE TABLE I_ARFILE LINES V_ITABLINES1.
V_ITABLINES1 = V_ITABLINES1 - 2.
IF V_ITABLINES1 <> V_ITABLINES.
MESSAGE 'NUMBER OF LINES READ ARE NOT SAME' TYPE 'E'.
LEAVE PROGRAM.
ENDIF.
LOOP AT I_ARITEM.
V_BAL1 = V_BAL1 + I_ARITEM-P_WRBTR.
V_DIS = V_DIS + I_ARITEM-P_WSKTO.
ENDLOOP.
CHECKING THE SUM OF THE BALANCE AMOUNT OF ALL THE RECORDS AND BALANCE AMOUNT IN TRAILER RECORD
IF V_BAL1 <> WA_ARTRAILER-TOBAL.
MESSAGE 'TOTAL AMOUNT IS NOT EQUAL TO THE SUM OF ALL THE AMOUNTS' TYPE 'E'.
ELSE.
CHECKING THE SUM OF THE DISCOUNT AMOUNT OF ALL THE RECORDS AND BALANCE AMOUNT IN TRAILER RECORD
IF V_DIS <> WA_ARTRAILER-TODIS.
MESSAGE 'TOTAL DISCOUNT AMOUNT IS NOT EQUAL TO THE SUM OF ALL THE DISCOUNT AMOUNTS' TYPE 'E'.
ENDIF.
CLEAR V_BAL1.
APPEND WA_ARITEM TO I_ARITEM.
CLEAR WA_ARITEM.
CLEAR WA_ARFILE.
CLEAR V_ITABLINES.
CLEAR V_ITABLINES1.
ENDIF.
ENDLOOP.
ENDLOOP.
ENDIF.
ELSE.
READ TABLE I_ARFILE INTO WA_ARFILE INDEX V_ITABLINES.
SPLIT WA_ARFILE AT C_PIPE INTO WA_ARTRAILER-P_RECTYPE
WA_ARTRAILER-COUNT
WA_ARTRAILER-TOBAL
WA_ARTRAILER-TODIS.
IF WA_ARTRAILER-P_RECTYPE = 9.
APPEND WA_ARTRAILER TO I_ARTRAILER.
ENDIF.
DESCRIBE TABLE I_ARTRAILER LINES V_ITABLINES.
IF V_ITABLINES <> 1.
MESSAGE 'NUMBER OF LINES READ ARE NOT SAME' TYPE 'E'.
LEAVE PROGRAM.
ENDIF.
CLEAR WA_ARFILE.
CLEAR V_ITABLINES.
ENDIF.
*CLEAR WA_ARFILE.
CLEAR V_ITABLINES.
CLEAR V_ITABLINES1.
ENDIF.
ENDLOOP.
In this code something wrong like....
I have to modify this code so that i can split the file based on the record indicator to different internal tables.
if you see my code I am going wrong after i split the data into header internal table... did the validations then I put the else condition and split the same record again into 2nd internal table. But I have to take the second record once the first one is filled..........
Can any one guide me how to do that plz...... I am bit confused with this
SRIHi,
Please check , first you need to split the file and move header, item, trailer , then using these internal tables do your validations
DESCRIBE TABLE I_ARFILE LINES V_LIN
READ TABLE I_ARFILE INTO WA_ARFILE INDEX 1.
IF SY-SUBRC EQ 0.
SPLIT WA_ARFILE AT C_PIPE INTO WA_ARHEADER-P_RECTYPE
WA_ARHEADER-P_PRCID
WA_ARHEADER-P_SENDR
WA_ARHEADER-P_CDATE
WA_ARHEADER-P_CTIME
WA_ARHEADER-P_OBTYP
WA_ARHEADER-P_SEQNO
WA_ARHEADER-P_FRTXT.
APPEND WA_ARHEADER TO I_HEADER.
ENDIF.
READ TABLE I_ARFILE INTO WA_ARFILE INDEX v_LIN.
IF SY-SUBRC EQ 0.
SPLIT WA_ARFILE AT C_PIPE INTO WA_ARTRAILER-P_RECTYPE
WA_ARTRAILER-COUNT
WA_ARTRAILER-TOBAL
WA_ARTRAILER-TODIS.
APPEND WA_ARTRAILER TO I_TRAILER.
ENDIF.
* FIRST DELETE TRAILER THEN GO FOR HEADER
READ TABLE I_ARFILE INTO WA_ARFILE INDEX V_LIN.
DELETE I_ARFILE INDEX SY-TABIX
READ TABLE I_ARFILE INTO WA_ARFILE INDEX 1.
DELETE I_ARFILE INDEX SY-TABIX.
LOOP AT I_ARFILE INTO WA_ARFILE.
SPLIT I_ARFILE AT C_PIPE
INTO WA_ARITEM-P_RECTYPE
WA_ARITEM-p_xblnr
WA_ARITEM-p_bldat
WA_ARITEM-p_budat
WA_ARITEM-p_blart
WA_ARITEM-p_awkey
WA_ARITEM-p_kunnr
WA_ARITEM-p_xref1
WA_ARITEM-p_xref2
WA_ARITEM-p_xref3
WA_ARITEM-p_wrbtr
WA_ARITEM-p_zterm
WA_ARITEM-p_zuonr
WA_ARITEM-p_rstgr
WA_ARITEM-p_wskto
WA_ARITEM-p_sgtxt.
APPEND WA_ARITEM TO I_ITEM.
ENDLOOP.
aRs -
SSIS question - Email the results of the table in pipe delimited format to the users
I am new to SSIS and I have a requirement. I have a sales table that has transactions for all months. I am trying to automate the process which involves following steps:
I need to query the table based on previous month.
Email the results of the table in pipe delimited format to the users.
What I am currently doing:
I created a temp table and load the query results in it every month by truncating the previous month’s data. Saved the query results in excel format. Open the excel and save it in csv format. Use SSIS package to convert csv to txt format and email
them manually with the txt file name as “Salesresults_<previousmonth>.
I just want to automate this process but the main challenge comes up with email with txt attached. Please help me out.First create a SSIS variable(@[User::Path]) that store folder path as "C:\Test".
Select the "Expression" tab in Send Mail Task Editor and select the appropriate property(FileAttachments) and assign the below expression.
@[User::Path] + "\\Salesresults_" + (DT_WSTR, 10) MONTH( GETDATE() ) + (DT_WSTR, 10) YEAR( GETDATE() ) + ".txt"
Regards, RSingh -
Report script. with pipe delimited?
hi
when i create script to extract some selective data with tab delimited it was ok
but how abt pipe delimited isit possible ?
i tried checking in oracle technical help but no use
for example
Account | Year | Period | instead of Account Year Period ( present script)
cheersi really appreciate ur help glenn
but i have this kind of issue
{Tabdelimited Rowrepeat no indentgen outmbrnames
supemptyrows supmissingrows supfeed sup commas supheading}
{ decimal 8 } {indentGen -5}
<row("year","period","scenario","Account".....blah blah
and i get output like this
jan FY09 Actual SG cust1
jan FY09 Actual UK
jan FY09 Actual IND
But iam looking for this
JKSG | 1 | FY09 | Actual | SG
JKUK | 2 | FY09 | Actual | UK
JKIND | 3 | Fy09 | Actual | IND
Tab delimited = pipe delimited
here i want to join Jk with calculating legal entity but what i wonder is Jk is not present in OUtline how can i keep in <ROW(....)
Can possible?
Edited by: user8800516 on Mar 9, 2010 12:02 AM -
FCC for Broken pipe delimited file
Hi Fellow SDNer's
I have a broken pipe delimited flat file . I want to do file content conversion for the same .
Can you please help me with the parameters
I am on PO 7.4 dual stack
Thanks
Ninad SaneHi Ninad
It looks like the broken pipe character is outside the US-ASCII character set.
ASCII Code - The extended ASCII table
You can try using the ASCII character to see if it works or not:-
Header.fieldSeparator = '0xA6'
Check also the following thread that mentions the use of non US-ASCII character.
Content conversion - endSeparator and fieldSeparator with unusual separators
In particular, it mentions OSS note 1936206 - if you have the corrections in place, you can try using MessageTransformBean and specifying the encoding with the following additional parameter.
xml.fieldSeparator.encoding=ISO-8859-1
Rgds
Eng Swee -
Java Regex Pipe Delimited ?
Hello
I am trying to split the string which is pipe delimited. I am new to Regex and new to Java.
My Java/Regex code line to split is:
listColumns = aLine.split("\\|"); // my code has 2 backslash-escapes chars plus 1 pipe char but this forum does not allow me to put pipes or escapes correctly and plain text help is of NO HELP 8^(
My input string has 3 leading and 4 trailing pipe characters
My Output from split: (3 leading emptry strings work but 4 trailing pipe delimiters dont work)
SplitStrings2:[]
SplitStrings2:[]
SplitStrings2:[]
SplitStrings2:[col1]
SplitStrings2:[col3]
SplitStrings2:[col4]
I do get 3 empty strings for all 3 leading pipes but no empty strings for the any traling 4 pipe characters.
What do I need to change the code such that all repeated pipes resulted in same number of empty strings returned by split method?
thanks
YuriB
Edited by: yurib on Nov 28, 2012 12:25 PM
Edited by: yurib on Nov 28, 2012 12:25 PM
Edited by: yurib on Nov 28, 2012 12:29 PM1. The pipe is a meta-character so escape it.
2. Split rolls things up for you unless you tell it otherwise.
String s = "|||A|B|C||||";
String[] array = s.split("[|]", 10);
for(int i=0; i < array.length; i++)
System.out.println("" + i + ": " + array);
Maybe you are looking for
-
I have a small problem i.e., in Item Category Configuration the fields for Revenue recongintion & Delimit Start date are already configured and are now grayed out. I am unable to change the option. Could any one tell me from can we control these fie
-
Invoice cancellation leading to creation of accounting document with partial items
Hi All, I faced an issue wherein there is an invoice created for items delivered (tangible goods as per the delivery document ) and services rendered ( intangible items). After doing an RTA for the invoice , when I cancel this invoice , the cancelled
-
Safari crashing (Yosemite)
Hello, I need help, please: My Safari started crashing unexpectedly, and keeps crashing if I try to reopen it. Already removed 3rd party internet plug-in's, but it continues to crash. I'm sad, I don't know what to do. OS X Yosemite 10.10.1 Here's the
-
Customized Incoming / Outgoing Excise Invoice
Hello Experts !!! my client is a trader of steel. they have excising . While mapping to standard excise forms in SAP Business One , thier reuirements weren't fulfilled. so i thought of creating customized forms for client . can any body please brief
-
Formatting icons not available for Constant Contact email templates - just blank images appear
Hello: My Firefox 3.6 doesn't allow me to see the icons in aWeber or Constant Contact. These are icons that I need to see when formatting an email in a template. The same thing happens in aweber. Constant Contact says it is a Firefox problem. I do no