I have a map going from a proprietary flat file to an X12 4010 204 file. There is an element in the 210 file called "piece", with attributes beneath it which are conditionally mapped and outputting as desired. The problem is the current output looks like this:
<DeclaredValueINS/>
<ShipperAttn/>
<PiecesDetail Pieces="0">
<Piece/>
<Piece/>
<Piece/>
<Piece/>
<Piece width="45.5" length="9.25" description="Riverside Furniture Placid Cove 42 Inch Round/Ov" count="1" height="49" weight="90" SerialNumber="16753-16754-Kit"/>
<Piece width="10.75" length="10.5" description="Riverside Furniture Placid Cove 42 Inch Round/Ov" count="2" height="23" weight="15" SerialNumber="16753-16754-Kit"/>
<Piece width="21.25" length="11.75" description="Riverside Furniture Placid Cove X-Back Side Chai" count="2" height="41.37" weight="22" SerialNumber="16759"/>
<Piece width="21.25" length="11.75" description="Riverside Furniture Placid Cove X-Back Side Chai" count="1" height="41.37" weight="22" SerialNumber="16759"/>
</PiecesDetail>
There is nothing mapped to the "Piece" element, nor a Loop above it (In fact, I have no idea how it is naturally looping through the data but am happy it is doing so). What I want is to suppress the elements---other output (yes I have looked at and duplicated the logic from the other maps like this one) doesn't have this problem.
I had it backwards--it was 204 to proprietary XML. I simply had to add the node to the conditions controlling the output of the desired lines below.
Related
I have only one requirement. I need to read PDF page size and determine if page is not bigger then 17x17 inches to not send it to some external service which rejects such pdfs.
Is there any free library working on .NET Core? I wasn't able to find it. Or maybe anyone implemented this by reading binary file?
A pdf does not HAVE TO declare page size externally since every page can be a different size thus 100 pages may be 100 different page sizes.
However many PDF will contain a text entry for one or more pages so you can (depending on construction) parse as text for /MediaBox and or potentially /CropBox dimensions.
So the first PDF example I pick on and open to search for /MediaBox in WordPad tells me its 210 mm x 297 mm (i.e my local A4) /MediaBox [0 0 594.95996 841.91998] and for a 3 page file all 3 entries are the same.
you can try that using command line as
type "filename.pdf" | find /i "/media"
but may not work in all cases so a bigger chance of result (but more chaff) is
type "filename.pdf" | findstr /i "^/media ^/crop"
The value is based on the default number of point size units per inch (so can be divided by 72 as a rough guide), however, thats not your aim since you know you dont want more that 17x72=1224.
So in simple terms, if either value was over 1224 then I could reject as "TOO BIG".
HOWEVER I need to also consider those two 0 values, thus if one was +100 then the limit becomes 100 more and more importantly, if one was -100 then your desired 17" restriction will fail at 1124.
So you can write in any method or language (even CMD) a simple test, however, that will require too much expanding to cover all cases, SO:-
Seriously I would use / shell a one line command tool like xpdf/poppler pdfinfo to parse all different types of PDF and then grep that output.
The output is similar for both with many lines but for your need
xpdf\pdfinfo -box filename
gives Page size: 594.96 x 841.92 pts (A4) (rotated 0 degrees)
and
poppler\pdfinfo -box filename
gives Page size: 594.96 x 841.92 pts (A4)
Thus to check the file does not exceed 17" (in either direction) it should be easy to set a comparison testing that both values are under 1224.01
When I type in vim it is automatically putting stuff onto the next lines for example when i have
Son 200 title African Art carving Songo people 1930/12/31 1995/10/22 890 Finn Borrowed
And I try adding 'the human' to Finn it does this
Son 200 title African Art
carving Songo people 1930/12/31 1995/10/22 890 Finn
the human Borrowed
It's been causing some errors if I don't manually backspace the "new lines" is there a way to stop this from happening?
This is caused by either 'textwidth' or 'wrapmargin' option. The 'formatoptions' option determines when exactly the wrapping happens.
As all of those options are usually set by a filetype plugin, you also need to inspect the current filetype. So,
:verbose setlocal tw? wm? fo?
would be a good starting point for troubleshooting. See :help ins-textwidth for a full explanation of the effect.
I've been stuck by this issue for a long time. I have two networks in my model, so I want to create different types of links with different breed turtle agentsets.
Let's name the 1st turtle agentset T1 and the 2nd T2, so what I did is the following:
breed [T1s T1]
undirected-link-breed [TL1s TL1]
breed [T2s T2]
undirected-link-breed [TL2s TL2]
;;Got error report
ask T1s [create-TL1s-with other n-of 10 T1s]
The last line gave an error reporting that "You cannot use breeded and unbreeded links in the same world". I'm quite confused about what this means.
And then, I changed the last line to:
ask T1s [create-links-with other n-of 10 T1s]
It worked this time, but if that's the case, how can I define two different types of links, i.e., TL1 and TL2, with different turtle agentsets T1s and T2s?
Can anybody help me out? I really appreciate it!
Thanks
That error means that you've created some links that have no breed (probably with create-link-with) before creating links with a breed, or vice-versa. If you want to use link breeds, you can never use create-link-with, create-link-to, or create-link-from. You must always use create-<breed>-with, create-<breed>-to, and create-<breed>-from.
So, search your code for instances of create-link-with, create-link-to, or create-link-from and either delete them or change them to create-<breed>-with, create-<breed>-to, or create-<breed>-from. If you're still getting the error, call clear-all or clear-links to make sure you've removed all unbreeded links.
As part of a programming assignment, I am trying to give color to all European countries.
I found the coordinates of these countries from the following wikipedia page.
Let's say, for example, that I want to color Northern Ireland. The coordinates are given here:
<path xmlns="http://www.w3.org/2000/svg" class="landxx gb eu" d="M 1260.508,337.032 C 1261.121,336.062 1262.494,336.081 1263.388,335.52 1263.057,335.277 1262.743,335.012 1262.448,334.727 1264.3,335.304 1265.011,333.238 1265.893,332.227 1266.732,331.266 1268.474,332.53 1268.718,330.767 1270.35,331.522 1272.386,329.639 1274.016,330.766 1274.677,331.222 1275.068,332.288 1275.375,332.975 1275.319,332.851 1276.594,334.325 1276.56,334.063 1276.597,334.341 1275.171,335.037 1274.978,335.231 1275.478,335.181 1276.972,334.543 1277.301,335.202 1277.635,335.87 1278.28,337.23 1277.138,337.536 1277.316,336.828 1277.055,335.884 1276.128,336.096 1276.687,336.427 1276.615,337.009 1276.268,337.464 1276.561,337.31 1276.811,337.331 1277.018,337.527 1277.091,338.02 1275.965,338.658 1275.586,338.698 1274.608,338.801 1274.61,340.437 1273.42,340.084 1272.419,339.787 1272.235,339.475 1271.382,340.035 1270.657,340.511 1269.467,340.023 1269.788,339.049 1269.388,339.07 1266.639,336.003 1266.454,337.971 1266.126,341.45 1261.861,338.159 1260.508,337.032" id="path2690"/>
I'd like to colour this country in a separate CSS file. I though I could do this by accessing the id of the country in the CSS file:
#path2690 {
fill: green;
}
It is not working, however. What is going wrong?
Thanks a lot in advance
There are a couple of problems here. Firstly you can't display a raw SVG <path> in an html file it has to be wrapped in a <svg> element.
Once you do that, it displays but the country is so small you can't see it no matter what colour it is even though the colouring actually works. If you give the <svg> element a viewBox of viewBox="1415 390 30 30" you can then see it and see that adjusting the colour in CSS changes it.
I have a flat file below. I'm having trouble with the schema with this layout. I switched it around to have a header and a detail and created an application with no problems, but the customer won't change the layout. This is probably pretty basic, but I'm a beginner. How do I take certain fields from this layout and create a header and a detail? The last date field needs to be in the header so you can see how it's random.
PO207730CO|1271|customer 1|john doe|1|161075|161075|BROOM FLAGGED LOBBY|2|5.62|24-Feb-2014|
PO207730CO|1271|customer 1|john doe|2|167316|167316|CLEANER DISPATCH SPRAY HOSPITAL DISINFECTANT W/BLEACH|1|59.84|24-Feb-2014|
PO207730CO|1271|customer 1|john doe|3|162175|162175|DUST PAN LOBBY|2|6.26|24-Feb-2014|
PO207730CO|1271|customer 1|john doe|4|163325|163325|MOP WET LARGE GENERAL-PURPOSE BLUE WB/LP|1|18.45|24-Feb-2014|
PO207730CO|1271|customer 1|john doe|5|164715|164715|SOAP PROVON MEDICATED TFX|1|32.79|24-Feb-2014|
PO207730CO|1271|customer 1|john doe|6|166338|166338|TOWEL MULTI-FOLD SCOTT WHITE|5|18.91|24-Feb-2014|
PO207814CO|1264|customer 2|jane doe|1|Cups||Bib 20x35 2 Ply Lab (756220)|1|17.47|24-Feb-2014|
PO207814CO|1264|customer 2|jane doe|2|Cups||Cup 9oz Translucent (098219)|1|24-Feb-2014|
PO207814CO|1264|customer 2|jane doe|3|Cups||Cup Foam 16oz (177190)|2|35.1|24-Feb-2014|
PO207814CO|1264|customer 2|jane doe|4|Cups||Lid 16/20 Whte Tab W/Sslot (194088)|2|16.57|24-Feb-2014|
PO207814CO|1264|customer 2|jane doe|5|Cups||Tissue 2-Ply 100-Sht (343227)|3|16.38|24-Feb-2014|
The basic problem here is the Flat File Disassembler does not support the concept of splitting/debatching based on changing values, PO207730CO -> PO207814CO for example.
So, you'll have to regroup by PO number at some following step.
You have a few options:
Use a Custom XSLT Map to group the lines based on the PO Number,
then split, by using a Receive Pipeline on an Orchestration for example.
https://social.technet.microsoft.com/wiki/contents/articles/17985.xslt-muenchian-grouping-biztalk-complex-transformation.aspx
Use an xPath Debatching Pattern in an Orchestration. http://www.biztalkgurus.com/biztalk_server/biztalk_2004/m/biztalk_2004_samples/32438.aspx
Either way, you would parse the flat file as you are now, row by row.
Thanks for the replies.
I went with an SSIS package to preload a table and build the pipe delimited file. I have Biztalk then picking up that file and debatching it the way I need it.