Questions tagged [data-conversion]

This tag refers to the process of converting the data type of one piece of information into another type.

1963 questions
15
votes
1 answer

Convert all json keys to lowercase using JQ

I'm looking to ingest a JSON file with arrays into my database. The json file with array items is as below:- { "campaignId": "11067182", "campaignName": "11067182", "channelId": "%pxbid_universal_site_id=!;", "channelName":…
Balajee Addanki
  • 690
  • 2
  • 9
  • 23
13
votes
6 answers

How to solve MemoryError using Python 3.7 pdf2image library?

I'm running a simple PDF to image conversion using Python PDF2Image library. I can certainly understand that the max memory threshold is being crossed by this library to arrive at this error. But, the PDF is 6.6 MB (approx), then why would it take…
Aakash Basu
  • 1,689
  • 7
  • 28
  • 57
13
votes
1 answer

How to convert UTM coordinates to lat and long in R

I am trying to run a species distribution model and need to create background points to run my logistic regression model. I have just created 500 randomPoints but they are in UTM coordinates and I need lat and long. Is there a way to convert them to…
Caroline4
  • 157
  • 1
  • 1
  • 3
13
votes
4 answers

Convert char* to uint8_t

I transfer message trough a CAN protocol. To do so, the CAN message needs data of uint8_t type. So I need to convert my char* to uint8_t. With my research on this site, I produce this code : char* bufferSlidePressure =…
Evans Belloeil
  • 2,413
  • 7
  • 43
  • 76
12
votes
2 answers

Converting NSString to NSData and vice versa

I am having an issue while trying to convert NSString to NSData and vice versa. I am trying to store encrypted string to my database. For that I am using AES algorithm. Now what I am doing is I get encrypted NSData and I am converting this to…
Kapil Choubisa
  • 5,152
  • 9
  • 65
  • 100
12
votes
4 answers

how to convert bool array in one byte and later convert back in bool array

I would like to pack bool array with max length 8 in one byte, send it over network and then unpack it back to bool array. Tried some solutions here already but it didn't work. I'm using Mono. I made BitArray and then tried to convert it in…
user1688686
  • 149
  • 1
  • 1
  • 5
12
votes
2 answers

decimals, javascript vs C#

I am trying to convert a JavaScript hashing function to C# hashing to do the exact same thing. I'm 99% there but I hit a snag with decimals used in this custom function. Am not sure why but this function convert a hashed value to a decimal for some…
IcantSpell
  • 206
  • 3
  • 9
11
votes
2 answers

Convert ODS to CSV using command line when Libreoffice instance is running

I'm working with an ODS file in LibreOffice, and every now and then I want to convert it to CSV from the command line. I have found two tools for this: libreoffice --headless --convert-to csv and unoconv -f csv but none of them works when there is…
foolo
  • 804
  • 12
  • 22
11
votes
1 answer

Creating a Proper avro schema for timestamp record

I would like to know what the proper avro schema would be for some json to avro conversion that is in this format: {"entryDate": "2018-01-26T12:00:40.930"} My schema: { "type" : "record", "name" : "schema", "fields" : [{ "name"…
koala421
  • 786
  • 3
  • 11
  • 27
11
votes
6 answers

Convert number to alphabet string (Javascript)

I want to convert a number to a char like: if number = 1 then A if number = 26 then Z if number = 27 then AA if number = 676 then ZZ if number = 456976 then ZZZZ Tried to find anything to help me with but I did not had any lucky. Anybody have a…
Ricardo Andrade
  • 137
  • 1
  • 1
  • 5
11
votes
3 answers

How to convert minutes to hours and minutes (without days)

I would like to display time in minues as an hour and minutes. Example 1: I want to display 125 minutes as a 2:05 I know I can to somethink like: $minutes=125; $converted_time = date('H:i', mktime(0,$minutes); This works fine, but if the time is…
Tikky
  • 1,253
  • 2
  • 17
  • 36
11
votes
2 answers

Why does Powershell file concatenation convert UTF8 to UTF16?

I am running the following Powershell script to concatenate a series of output files into a single CSV file. whidataXX.htm (where xx is a two digit sequential number) and the number of files created varies from run to run. $metadataPath =…
dwwilson66
  • 6,806
  • 27
  • 72
  • 117
11
votes
1 answer

Convert an integer to a 2 byte Hex value in Python

For a tkinter GUI, I must read in a Hex address in the form of '0x00' to set an I2C address. The way I am currently doing it is by reading the input as a string, converting the string to an integer, then converting that integer to an actual Hex…
BDP
  • 191
  • 1
  • 4
  • 11
10
votes
3 answers

Creating a time.Duration from float64 seconds

I have a float64 containing a duration in seconds. I'm looking for a way to convert this value to a time.Duration. I'm able to perform this conversion, but I'm wondering if there is not a more elegant way. The approach I have is this: var…
Ulrich Eckhardt
  • 16,572
  • 3
  • 28
  • 55
10
votes
3 answers

UTF conversion functions in C++11

I'm looking for a collection of functions for performing UTF character conversion in C++11. It should include conversion to and from any of utf8, utf16, and utf32. A function for recognizing byte order marks would be helpful, too.
Brent
  • 4,153
  • 4
  • 30
  • 63