Urgent + Search a delimited file for more then one string
Hi All
Urgent please help I am trying to search a file for 2 different strings.
This is how the command prompt will look like
java match "-t|" -4 -f Harvey -10 -f Atlanta callbook.txtPlease help me with identifying how many search criterias have been entered on command prompt.
"-t|" - denotes a delimiter
-4 - denotes the field number
-f - case sensitive
Thanks
Hi
Thanks for your quick response and I apologise I will never put urgent on my posting again.
C:\>java match "-t|" -4 -f Harvey -10 -f Atlanta callbook.txt
This example lists records for Atlanta with first name Harvey.
I am able to get one search criteria but when I have 2 as above (Harvey and Atlanta) I get lost I do not know how to get these arguments from the commandline and still do a search correctly. My code at the moment is doint a hard coded search so I was trying to extract the arguments that's where I got stuck.
The main aim of my app is to search a delimited file for a search criteria passed through a command prompt.
This is what I have done so far.
import java.io.*;
import java.util.*;
public class assess1
static public void main(String args[])
int[] totals = new int[10];
try
BufferedReader inFile = new BufferedReader(new FileReader(args[0]) );
try
String line;
String StrSearch = "HARVEY";
int counter = 0;
boolean foundIt = false;
while((line = inFile.readLine()) != null)
// search for the string
String[] values = line.split("\\|");
for (String str : values) {
if (str.equals("HARVEY")) {
System.out.println(line);
System.out.println();
counter++;
if (counter == 0) {
System.out.println("String not found");
inFile.close();
catch(IOException e)
System.err.println("IO exception");
System.exit(1);
catch(NumberFormatException e)
System.err.println("Value " + e.getMessage() + "not numeric");
catch(FileNotFoundException e)
System.err.println( "Couldn't open " + e.getMessage() );
System.exit(1);
}
Similar Messages
-
Printing salesinvoices, is it possible to do it for more then one invoice?
Is there a method to use VF03 with a selection for more then one sales invoices?
I want to print them as pdf file, so I have to fill in the field billingdocument, but I need it for more then one invoice at the same time.
I tried but it seems not to work. Is it not possible? Or is there another solution to print more then one invoices at the same time?Hi,
check in the Commnication method of your Output type whether In the NUMBER OF MESSAGES field was maintained as 4
No of messages field will control the Number of invocies to print
check this and revert
thanks
santosh -
How to create a service call for more then one item
Hi All,
How to create a service call for more then one item. i.e. the service call should be logged for more then one itemAs you noticed this is not possible by design.
Maybe you could have a dummy item for that purpose and register the real items to be handled in a UDT...
HTH -
Is it possible to retrieve report for more then one record at Bi Pub
is it possible to retrieve report for more then one record at a time using BI Publisher on siebel Application
Hi Sudhir,
We have tried this.
I think currently you can query for records you want on UI and run report , then you can see the result set of query in report.
But i think in future releases of BIP the feature to run a report for selected & Multiple Selected records will be provided.
Thanks,
Vamsi -
I've been trying to find more information on this and I apologies if this has already been answered. I just don't know the correct way to ask this. We have a SharePoint List at the company that we have people input information into different columns. The
problem is most of those information are very repetitive. Is there a way for me to search more then one field text in the column and just input that same information in?
ex:
Column 1
Column 2
Date:
883851
MidWest
User input
8831518
MidWest
User input
On the search field in the SharePoint List, I would need to search for 883851, 8831518 etc, would view those requested numbers, then I would click edit and change dates to those rows. Does that make sense? I'm sorry I'm fairly new at sharepoint.I think what you're asking is about having repetitive options in a list, show up easily for new items being created.
This can be done by setting the columns that contain repetitive information to Choice fields. In the configuration of the Choice field, check the box for "Allow custom values". Now as users are entering data into the list, the dropdown of options
for a given field grows and users can quickly see and select previously entered and thus repetitive values for the given fields.
I trust that answers your question...
Thanks
C
|
RSS |
http://crayveon.com/blog |
SharePoint Scripts | Twitter |
Google+ | LinkedIn |
Facebook | Quix Utilities for SharePoint -
How to use 'BAPI_GOODSMVT_CREATE' for more then one row selected ???
Hi,
I am using bapi , BAPI_GOODSMVT_CREATE , my requirement is that first perform ALV display with check boxes & then user can selsct any number of rows & then on clicking execute button this bapi is triggered , now my ques is that if i am selecting rows one by one & executing , then am able to post data successfully, but if am selecting more then one row at a time then its giving me error
" exactly one serial no must be selected (instead of more then two / three ) ."
plz help me .
this is how i am filling data in BAPi & bapi call
FORM FILL_BAPIDATA .
wa_GOODSMVT_HEADER-PSTNG_DATE = sy-datum.
wa_GOODSMVT_HEADER-doc_DATE = sy-datum.
wa_goodsmvt_code-gm_code = c_gmcode.
LOOP AT it_final INTO wa_final.
wa_GOODSMVT_ITEM-MOVE_TYPE = c_movtype. " '313'.
wa_GOODSMVT_ITEM-material = WA_final-MATNR.
wa_GOODSMVT_ITEM-ENTRY_QNT = wa_final-verme.
wa_GOODSMVT_ITEM-plant = WA_final-WERKS. "'DB10'.
wa_GOODSMVT_ITEM-STGE_LOC = WA_final-LGORT.
wa_GOODSMVT_ITEM-BATCH = WA_final-CHARG.
wa_GOODSMVT_ITEM-BATCH = l_charg.
append wa_GOODSMVT_ITEM to IT_GOODSMVT_ITEM.
clear: wa_GOODSMVT_ITEM.
ENDLOOP.
LOOP AT it_final INTO wa_final.
wa_serialnumber-SERIALNO = wa_final-sernr.
APPEND wa_serialnumber to it_serialnumber.
CLEAR wa_serialnumber.
ENDLOOP.
LOOP AT it_position2 INTO wa_position2.
wa_serialnumber-MATDOC_ITM = wa_position2-wepos .
MODIFY it_serialnumber INDEX sy-tabix from wa_serialnumber TRANSPORTING MATDOC_ITM .
ENDLOOP.,
data: begin of mthead.
include structure bapi2017_gm_head_ret.
data: end of mthead.
CALL FUNCTION 'BAPI_GOODSMVT_CREATE'
EXPORTING
GOODSMVT_HEADER = wa_GOODSMVT_HEADER
GOODSMVT_CODE = wa_GOODSMVT_CODE
IMPORTING
GOODSMVT_HEADRET = mthead
MATERIALDOCUMENT = w_MATERIALDOCUMENT
MATDOCUMENTYEAR = w_MATDOCUMENTYEAR
TABLES
GOODSMVT_ITEM = IT_GOODSMVT_ITEM
GOODSMVT_SERIALNUMBER = IT_SERIALNUMBER
RETURN = IT_RETURN
GOODSMVT_SERV_PART_DATA =
EXTENSIONIN =
APPEND w_MATERIALDOCUMENT to it_GOODSMVT1 .
IF sy-subrc = 0 .
CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'
*MESSAGE text-016 TYPE 'I'.
PERFORM msg_log .
ENDIF.Hi,
Did u check the serial numbers table before calling the BAPI. Might be the case tht same serial number is assigned for all items, in this case the goods movement may be possible with same serial number for all items.
Reagrds,
Aditya
Edited by: aditya on Aug 11, 2009 11:46 AM -
SO_DOCUMENT_SEND_API1--- example code for more then one attachment send
Hi All,
I am using this function module for sending mail along with any attachment(.exe) . But i am facing problem to send more than one attachment.
Please give me sample code for this .
for all usefull answers points will be awwarded.
thanx in advance
Deepak KumarHi,
Don't expect everything to come to ur door step.
This is a forum to give ideas, not to supply the code for u...
Learn how to search in the forums...
Refer the below link..
Sending mail with 2 attachments
Cheers,
Simha. -
Regular Expression to Search Comma Delimited File for any of 3 Values
Hi,
I'd like to parse a table column that contains a comma delimited string for any of 3 values, 1200, 1400, 1600 just to see if they're present using Regexp_instr. If someone has an expression available please pass it along.
Thanks,
VictorOr you could do it like this too...
SQL> ed
Wrote file afiedt.buf
1 with t as (select 1 as id, '1000,2000,3000' as txt from dual union all
2 select 2, '1200,1300,1400' from dual union all
3 select 3, '1000,1300,1600' from dual)
4 -- end of test data
5 select *
6 from t
7* where regexp_like(txt,'(^|,)(1200|1400|1600)(,|$)')
SQL> /
ID TXT
2 1200,1300,1400
3 1000,1300,1600 -
If i want to write something that waits for more then one thing
how do i do that?
if it's for one thing i'll write:
sinchronized(a){
while (true){
wait();
my_code();
}He's not saying he wants to wait for multiple
conditions. Unless I just don't understand what he's
saying (real possibility there.):) It sounded to me like he wanted to wait for multiple things to happen.
CountDownLatch works fine for waiting on multiple
threads. If one thread wants to force the await() to
end, it can force the latch count to zero. Any thread
can also call interrupt() on the waiting thread (as
long as it has a reference to the thread object.)A CountdownLatch set to one can also be used to wait for one of a set of events to occur. Of course you'd need further information to determine which event it was.
The kinds of "events" can influence the shape of the solution here. Eg if you're interested in muiltiple I/O events then you need to use an I/O framework that supports a select-style operation. -
Can mrp run consider material availability for more then one plant?
Hı PP Gurus,
My Case:
Material "A" is maintained for plant "X" and "Y" for example. When i execute mrp for material A i have to specify a plant. And the system creates planned orders just considering the quantity in that plant. But i want mrp to see the quantities of both plant.
I mean when i execute mrp the system must consider the quantities for both plant and create planned order or not.
Is there a way to fix it?
Thank you indeed.
Evren TemizYou can use Scope of Planning for this.
Total planning covers the planning of all the materials that are relevant for requirements planning and includes the BOM explosion for materials with a bill of material.
You can use total planning for a single plant or you can use the scope of planning to control whether the total planning run is executed on a multi-plant level
If you have activated MRP with MRP areas, you can also combine MRP areas in the scope of planning as an alternative to plants.
With the help of the scope of planning, you can control whether the total planning run is to be carried out:
1. For one plant (as previously without scope of planning)
2. For several plants
3. For an MRP area
4. For several MRP areas
You define the scope of planning for the total planning run in Customizing for MRP, in the IMG activity Scope of planning for total planning run .
You can carry out total planning for a scope of planning online or as a background job. The planning run must always be started with parallel processing.
You can use the scope of planning for total planning in Material Requirements Planning, Master Production Scheduling and Long-Term Planning.
Please refer to the below links -
http://help.sap.com/saphelp_46c/helpdata/en/35/b0e95c87a62488e10000009b38f9b7/frameset.htm
http://help.sap.com/saphelp_46c/helpdata/en/d7/5c9366f47811d1a6ba0000e83235d4/frameset.htm
Hope this helps you. -
Hello I am creating a report with wildcards, I need the users to be able to look up results that are in the comments as well as dates. this is what I have so far but I don't think I did this correctly
SELECT CompletionDate, Accomplishments, accomplishID, Participant
FROM Accomplishments_tbl
WHERE (CompletionDate BETWEEN @Beginning_CompletionDate AND @End_CompletionDate) AND
(Accomplishments LIKE '%Martiza Pinto%,%Arleen Poag%,%Cynthia Flores-LaFleur%,%Jennifer James%')
ORDER BY CompletionDatesorry about that I ran this, works great thank you
SELECT
A.CompletionDate,
A.Accomplishments,
A.accomplishID,
A.Participant
FROM
Accomplishments_tbl A
CROSS
APPLY(SELECT
FROM
(values
'Martiza Pinto'),('Arleen
Poag'),('Cynthia Flores-LaFleur'),('Jennifer
James')) List(Name)
WHERE
A.Accomplishments
LIKE
+ List.Name
+
X -
????????????????????
Log in to the Mac App Store with your Apple-ID on all your Macs, and you can download Lion as many times as you want.
Cheers -
Hdiutil and creation of more then one partition in a dmg and sparse image?
Hello,
My main question,
after reading the man page and googling, I can't find any way to create a DMG file with more then one partition. Is this even possible?
My finaly goal is to attach those with -mountRandom and - nobrowse from inside a cocoa.app.
I need the return value to get the random path to those partitions.
hdiutil attach test.dmg -mountrandom /Users/dev/Desktop/testdmg
/dev/disk7 GUIDpartitionscheme
/dev/disk7s1 Apple_HFS /Users/dev/Desktop/testdmg/dmg.A43MrA
But I see that when I use a mutli partition dmg ( here simulated ) I will have to look for one or more random paths, something like this.
hdiutil attach test.dmg -mountrandom /Users/dev/Desktop/testdmg
/dev/disk7 Applepartitionscheme
/dev/disk7s1 Applepartitionmap
/dev/disk7s2 Apple_HFS /Users/dev/Desktop/testdmg/dmg.A43MrA
/dev/disk7s3 Apple_HFS /Users/dev/Desktop/testdmg/dmg.7IaUpK
What is the best way?
to grep a line wich contains '/dmg./ and then awk print $3 ?
path=/Users/dev/Desktop
hdiutil attach $path/test.dmg -mountrandom $path/testdmg | grep '/dmg.' | awk '{ print $3 }'
but what when I attach f.e a sparse image not using the -mountRandom, then I have no '/dmg.' just volumes?
Is that doable in one universal piece of code?I can only answer your question re:multi partition on a .dmg with:
doug-penningtons-power-mac-g4:Desktop dougp$ diskutil list
/dev/disk0
#: TYPE NAME SIZE IDENTIFIER
0: Applepartitionscheme *57.3 Gi disk0
1: Applepartitionmap 31.5 Ki disk0s1
2: Apple_Driver43 28.0 Ki disk0s2
3: Apple_Driver43 28.0 Ki disk0s3
4: AppleDriverATA 28.0 Ki disk0s4
5: AppleDriverATA 28.0 Ki disk0s5
6: Apple_FWDriver 256.0 Ki disk0s6
7: AppleDriverIOKit 256.0 Ki disk0s7
8: Apple_Patches 256.0 Ki disk0s8
9: Apple_HFS Joe 57.1 Gi disk0s10
/dev/disk1
#: TYPE NAME SIZE IDENTIFIER
0: Applepartitionscheme *10.0 Mi disk1
1: Applepartitionmap 31.5 Ki disk1s1
2: Apple_HFS me 10.0 Mi disk1s2
doug-penningtons-power-mac-g4:Desktop dougp$ diskutil partitionDisk disk1 2 HFS+ leroy 5M HFS+ madge 5M
Started partitioning on disk disk1
Creating partition map
Formatting disk1s2 as Mac OS Extended with name leroy
Formatting disk1s3 as Mac OS Extended with name madge
[ + 0%..10%..20%..30%..40%..50%..60%..70%..80%..90%..100% ]
Finished partitioning on disk disk1
/dev/disk1
#: TYPE NAME SIZE IDENTIFIER
0: Applepartitionscheme *10.0 Mi disk1
1: Applepartitionmap 31.5 Ki disk1s1
2: Apple_HFS leroy 5.0 Mi disk1s2
3: Apple_HFS madge 5.0 Mi disk1s3
Message was edited by: doug pennington -
How to read data from Logical Database ADA for more than one financia year
Hi,
I need to read data from ADA logical database and ANLCV node for current financial year 2007 and for the next 3 years 2008, 2009, 2010. When I do this using program attached below, I receive only data for one year, which is entered at the selection screen in the field BERDATUM. How should I modify my program to read ANLCV node for more then one year ? Could anybody help me ?
Kind regards,
Zbigniew Debowski
REPORT ZWRZD075.
NODES: anlav, anlcv.
START-OF-SELECTION.
GET anlav.
WRITE:/ anlav-anln1, ' ', anlav-anln2.
GET anlcv.
WRITE:/ anlcv-kansw, ' ', anlcv-knafa, ' ', anlcv-gjahr.Hi!
Have you already tried your luck in Java Programming forum?
Regards,
Thomas -
Same variable "used in more then one InfoObject"
I want to use the same user entered value as part of the definition of two different restricted key figures, restricting on two different characteristics. Basically the user will enter a date, and one key figure includes only those with a "Calendar date" < the entered date, the other will have "Date1" less then the entered date and "Date2" greater the entered date. When I try that, I get the error "Variable Select Date used in more then one infoObject". How can I either use the same variable for more then one characteristic, or create a new variable that takes the value of the "Select Date" variable without prompting the user to enter the same date multiple times.
thanks
ValHi Val,
Hereunder an example of a routine extracting year from month, month inserted manually (year = anno in Italian):
DATA: loc_var_range LIKE rrrangeexit.
DATA: l_s_range TYPE rsr_s_rangesid.
DATA: v_anno(4) TYPE c.
CASE i_vnam.
WHEN 'VCE_ANNO'.
IF i_step = 2.
CLEAR l_s_range.
LOOP AT i_t_var_range INTO loc_var_range
WHERE vnam = '0PCALMON'.
CLEAR v_anno.
v_anno = loc_var_range-low(4).
l_s_range-low = v_anno.
L_S_RANGE-HIGH =
l_s_range-sign = 'I'.
l_s_range-opt = 'EQ'.
ENDLOOP.
APPEND l_s_range TO e_t_range.
ENDIF.
endcase.
Ciao.
Riccardo.
Maybe you are looking for
-
Error while creating transformations
Hi, I am new to BI 7.0, i m getting error while i creating transformations on my cube. i am loading flat file and my file structure is Sales ord Customer Price Calday I have assigned the price as Fixed currecy to 'USD' i`don't think we have to add
-
How do I create a group contact list in Mail???
I have 20 parents on my son's hockey team that I need to send emails to and want to create a contact list so I don't have to put in individual emails every time. Comments please. Thanks.. Rob
-
BI Publisher Desktop Install Error
1.) I uninstalled XML Desktop via the XP control panel... 2.) BIP Desktop would not install and indicated I had 'not' uninstalled my previous ver of XML Pub... 3.) I reinstalled XML Desktop and then used Oracle's setup.exe included with XML Publisher
-
There is this command line program I want to wrap with a Java class in order to make it available so that it can be transparently called. How can I call or execute external programs/commands from JAVA... is not native code that I want to run... Thank
-
How can I add contrast to my photos while shooting?
using a T4i, shooting JPEGs, i usually need to add contrast to my scenic/landscapes.... Solved! Go to Solution.